A male-specific component, 11-cis-vaccenyl acetate (cVA) works as an anti-aphrodisiac pheromone in Drosophila melanogaster. The presence of cVA on a male suppresses the courtship motivation of other males and contributes to suppression of male-male homosexual courtship, while the absence of cVA on a female stimulates the sexual motivation of nearby males and enhances the male-female interaction. However, little is known how a male distinguishes the presence or absence of cVA on a target fly from either self-produced cVA or secondhand cVA from other males in the vicinity. In this study, we demonstrate that male flies have keen sensitivity to cVA; therefore, the presence of another male in the area reduces courtship toward a female. This reduced level of sexual motivation, however, could be overcome by pretest odor exposure via olfactory habituation to cVA. Real-time imaging of cVA-responsive sensory neurons using the neural activity sensor revealed that prolonged exposure to cVA decreased the levels of cVA responses in the primary olfactory center. Pharmacological and genetic screening revealed that signal transduction via GABAA receptors contributed to this olfactory habituation. We also found that the habituation experience increased the copulation success of wild-type males in a group. In contrast, transgenic males, in which GABA input in a small subset of local neurons was blocked by RNAi, failed to acquire the sexual advantage conferred by habituation. Thus, we illustrate a novel phenomenon in which olfactory habituation positively affects sexual capability in a competitive environment.