The
Drosophila
wing was proposed to be a taste organ more than 35 years ago, but there has been remarkably little study of its role in chemoreception. We carry out a differential RNA-seq analysis of a row of sensilla on the anterior wing margin and find expression of many genes associated with pheromone and chemical perception. To ask whether these sensilla might receive pheromonal input, we devised a dye-transfer paradigm and found that large, hydrophobic molecules comparable to pheromones can be transferred from one fly to the wing margin of another. One gene,
Ionotropic receptor
(
IR
)
52a
, is coexpressed in neurons of these sensilla with
fruitless
, a marker of sexual circuitry;
IR52a
is also expressed in legs. Mutation of
IR52a
and optogenetic silencing of IR52a
+
neurons decrease levels of male sexual behavior. Optogenetic activation of IR52a
+
neurons induces males to show courtship toward other males and, remarkably, toward females of another species. Surprisingly,
IR52a
is also required in females for normal sexual behavior. Optogenetic activation of IR52a
+
neurons in mated females induces copulation, which normally occurs at very low levels. Unlike other chemoreceptors that act in males to inhibit male–male interactions and promote male–female interactions, IR52a acts in both males and females, and can promote male–male as well as male–female interactions. Moreover, IR52a
+
neurons can override the circuitry that normally suppresses sexual behavior toward unproductive targets. Circuit mapping and Ca
2+
imaging using the
trans
-Tango system reveals second-order projections of IR52a
+
neurons in the subesophageal zone (SEZ), some of which are sexually dimorphic. Optogenetic activation of IR52a
+
neurons in the wing activates second-order projections in the SEZ. Taken together, this study provides a molecular description of the chemosensory sensilla of a greatly understudied taste organ and defines a gene that regulates the sexual circuitry of the fly.