Sex-specific neurons play pivotal roles in regulating sexually dimorphic behaviors. In insects, the sex determination gene doublesex (dsx) establishes major sexual dimorphism of the nervous system, in which male-specific dsxM promotes neuronal development, while female-specific dsxF inhibits neuronal development by promoting neuronal apoptosis. In this study, we find that dsx regulates the number of dsx-expressing central neurons in Drosophila in cell-specific manners. Although dsxM overall promotes an increase in the number of dsx neurons, it inhibits the emergence of specific pC1 neurons. dsxF reduces the number of different pC1/pC2 subtypes, but promotes the formation of pC1d. We also find that dsxM and dsxF barely affect the number of some pC2 neurons. Changes in the number of pC1/pC2 neuron numbers alter their roles in regulating different behaviors, including courtship, aggression, and locomotion. Our results illustrate the multifaceted functions of dsx in sexually dimorphic neuronal development and behaviors.