Oviposition is a female-specific behavior that directly affects fecundity, and therefore fitness. If a fertilized female encounters another male that she has evaluated to be of better quality than her previous mate, it would be beneficial for her to remate with this male rather than depositing her eggs. Females who decided not to remate exhibited rejection behavior toward a courting male and engaged in oviposition. Although recent studies of Drosophila melanogaster identified sensory neurons and putative second-order ascending interneurons that mediate uterine afferents affecting female reproductive behavior, little is known about the brain circuitry that selectively activates rejection versus oviposition behaviors. We identified the sexually dimorphic pC2l and female-specific pMN2 neurons, two distinct classes of doublesex (dsx)-expressing neurons that can initiate ovipositor extension associated with rejection and oviposition behavior, respectively. pC2l interneurons, which induce ovipositor extrusion for rejection in females, have homologues that control courtship behavior in males. Activation of these two classes of neurons appears to be mutually exclusive and each governs hierarchical control of the motor program in the VNC either for rejection or oviposition, contributing centrally to the switching on or off of the alternative motor programs.