A primary function of males for many species involves mating with females for reproduction. Drosophila melanogaster males respond to the presence of other males by prolonging mating duration to increase the chance of passing on their genes. To understand the basis of such complex behaviors, we examine the genetic network and neural circuits that regulate rival-induced Longer-Mating-Duration (LMD). Here, we identify a small subset of clock neurons in the male brain that regulate LMD via neuropeptide signaling. LMD requires the function of pigment-dispersing factor (PDF) in four s-LNv neurons and its receptor PDFR in two LNd neurons per hemisphere, as well as the function of neuropeptide F (NPF) in two neurons within the sexually dimorphic LNd region and its receptor NPFR1 in four s-LNv neurons per hemisphere. Moreover, rival exposure modifies the neuronal activities of a subset of clock neurons involved in neuropeptide signaling for LMD.