Pain comorbid with depression occurred frequently in clinical settings. This study aims to explore the molecular mechanism underlying antidepressant and analgetic effect of salvianolic acid B (SalB) in comorbid pain in depression induced by chronic restraint stress (CRS), which associates with GABAergic neuron activation in the amygdala and the ERK-CREB-BDNF signaling pathway. The differentially expressed genes related to comorbid pain in CRS-induced depression were screened through bioinformatics analysis. After CRS treatment for 3 weeks, depression-like behaviors were developed in GAD2-tdT mice. The retrograde tracer cholera toxin B subunit combined with retrograde tracer CTB-488 was injected into the parafascicular nucleus of thalamus to project GABAergic neurons to observe the labeling of neurons in the whole brain. After treatment with SalB and ERK-CREB-BDNF signaling pathway inhibitor, CRS mice showed a variety of depression-like behaviors, accompanied by enhanced activity of GABAergic neurons in the amygdala projecting to parafascicular nucleus of thalamus. BDNF underexpression occurred in the CRS mice. Overexpressed BDNF activated ERK-CREB-BDNF signaling pathway to alleviate comorbid pain in CRS-induced depression. After intraperitoneal injection of SalB, the depression-like behaviors and pain threshold in CRS mice were alleviated, the effects of which could be eliminated by ERK-CREB-BDNF signaling pathway antagonist. Collectively, SalB inhibits the excitation of GABAergic neurons in the amygdala and activates the ERK-CREB-BDNF signaling pathway through the parafascicular nucleus of thalamus, whereby alleviating comorbid pain in CRS-induced depression in mice.