The ventrolateral periaqueductal gray (vlPAG) collaborates with the dorsal raphe (DR) in pain regulation and emotional response. However, the roles of vlPAG and DR γ-aminobutyric acid (GABA)-ergic neurons in regulating nociception and anxiety are contradictory and poorly understood. Here, we observed that pharmacogenetic co-activation of vlPAG and DR GABAergic (vlPAG-DR) neurons enhanced sensitivity to mechanical stimulation and promoted anxiety-like behavior in naïve mice. Simultaneous inhibition of vlPAG-DR neurons showed adaptive anti-nociception and anti-anxiety effects on mice with inflammatory pain. Notably, vlPAG and DR neurons exhibited opposing effects on the sensitivity to mechanical stimulation in both naïve state and inflammatory pain. In contrast to the role of vlPAG neurons in pain processing, chemogenetic inhibition and chronic ablation of DR neurons remarkably promoted nociception while selectively activating DR neurons ameliorated inflammatory pain. Additionally, utilizing optogenetic technology, we observed that the pronociceptive effect arising from DR neuronal inhibition was reversed by the systemic administration of morphine. Our results collectively provide new insights into the modulation of pain and anxiety by specific midbrain GABAergic subpopulations, which may provide a basis for cell type-targeted or subregion-targeted therapies for pain management.