Chronic pain affects millions globally, yet no universally effective treatment exists. The primary motor cortex (M1) has been a key target for chronic pain therapies, with electrical stimulation of the M1 (eMCS) showing promise. However, the mechanisms underlying M1-mediated analgesic effects are not fully understood. We investigated the role of the primary somatosensory cortex (S1) in M1-mediated analgesia using a neuropathic pain mouse model. In this model, neuropathic pain is associated with increased spontaneous activity of layer V pyramidal neurons (LV-PNs) in the S1, partly attributed to the reduced activity of somatostatin-expressing inhibitory neurons (SST+ INs), which normally suppress LV-PNs. While manipulation of either LV-PNs or SST+ INs has been shown to alleviate pain, the role of S1 in M1-mediated analgesia has not been identified. Using multichannel silicon probes, we applied eMCS to neuropathic mice and observed significant analgesia. Histological analyses revealed that eMCS activated SST+ INs and suppressed hyperactivity of LV-PNs in the S1, suggesting that eMCS suppresses pain by modulating S1 neuronal circuits, alongside other pain-related regions. Notably, eMCS induced long-lasting analgesia, persisting for at least 2 d poststimulation. These findings implicate S1 as a critical mediator of eMCS-induced analgesia and suggest eMCS as a potential durable therapeutic strategy for chronic pain.