In Drosophila melanogaster, the sex pheromone produced by males, cis-vaccenyl acetate (cVA), evokes a stereotypic gender-specific behavior in both males and females. As Drosophila adults feed, mate, and oviposit on food, they perceive the pheromone as a blend against a background of food odors. Previous studies have reported that food odors enhance flies’ behavioral response to cVA, specifically in virgin females. However, how and where the different olfactory inputs interact has so far remained unknown. In this study, we elucidated the neuronal mechanism underlying the response at an anatomical, functional, and behavioral level. Our data show that in virgin females cVA and the complex food odor vinegar evoke a synergistic response in the cVA-responsive glomerulus DA1. This synergism, however, does not appear at the input level of the glomerulus, but is restricted to the projection neuron level only. Notably, it is abolished by a mutation in gap junctions in projection neurons and is found to be mediated by electrical synapses between excitatory local interneurons and projection neurons. As a behavioral consequence, we demonstrate that virgin females in the presence of vinegar become receptive more rapidly to courting males, while male courtship is not affected. Altogether, our results suggest that lateral excitation via gap junctions modulates odor tuning in the antennal lobe and drives synergistic interactions between two ecologically relevant odors, representing food and sex.