The elaborate courtship ritual of Drosophila males is dictated by neural circuitry established by the transcription factor Fruitless and triggered by sex-specific sensory cues. Deciphering the role of different stimuli in driving courtship behavior has been limited by the inability to selectively target appropriate sensory classes. Here, we identify two ion channel genes belonging to the degenerin/epithelial sodium channel/pickpocket (ppk) family, ppk23 and ppk29, which are expressed in fruitless-positive neurons on the legs and are essential for courtship. Gene loss-of-function, cell-inactivation, and cell-activation experiments demonstrate that these genes and neurons are necessary and sufficient to inhibit courtship toward males and promote courtship toward females. Moreover, these cells respond to cuticular hydrocarbons, with different cells selectively responding to male or female pheromones. These studies identify a large population of pheromone-sensing neurons and demonstrate the essential role of contact chemosensation in the early courtship steps of mate selection and courtship initiation.