The spinal ejaculation generator (SEG) is located in the central gray (lamina X) of the rat lumbar spinal cord and plays a pivotal role in the ejaculatory reflex. We recently reported that SEG neurons express the oxytocin receptor and are activated by oxytocin projections from the paraventricular nucleus of hypothalamus (PVH). However, it is unknown whether the SEG responds to oxytocin in vivo. In this study, we analyzed the characteristics of the brain–spinal cord neural circuit that controls male sexual function using a newly developed in vivo electrophysiological technique. Optogenetic stimulation of the PVH of rats expressing channel rhodopsin under the oxytocin receptor promoter increased the spontaneous firing of most lamina X SEG neurons. This is the first demonstration of the in vivo electrical response from the deeper (lamina X) neurons in the spinal cord. Furthermore, we succeeded in the in vivo whole-cell recordings of lamina X neurons. In vivo whole-cell recordings may reveal the features of lamina X SEG neurons, including differences in neurotransmitters and response to stimulation. Taken together, these results suggest that in vivo electrophysiological stimulation can elucidate the neurophysiological response of a variety of spinal neurons during male sexual behavior.