The ability to distinguish males from females is essential for productive mate selection and species propagation. Recent studies in Drosophila have identified different classes of contact chemosensory neurons that detect female or male pheromones and influence courtship decisions. Here, we examine central neural pathways in the male brain that process female and male pheromones using anatomical, calcium imaging, optogenetic, and behavioral studies. We find that sensory neurons that detect female pheromones, but not male pheromones, activate a novel class of neurons in the ventral nerve cord to cause activation of P1 neurons, male-specific command neurons that trigger courtship. In addition, sensory neurons that detect male pheromones, as well as those that detect female pheromones, activate central mAL neurons to inhibit P1. These studies demonstrate that the balance of excitatory and inhibitory drives onto central courtship-promoting neurons controls mating decisions.