The dorsal root ganglion (DRG) is actively involved in the development of neuropathic pain (NP), serving as an intermediate station for pain signals from the peripheral nervous system to the central nervous system. The mechanism by which DRG is involved in NP regulation is not fully understood. The immune system plays a pivotal role in the physiological and pathological states of the human body. In recent years, the immune system has been thought to play an increasingly important role in the pathogenesis of NP. The immune system plays a key role in pain through specific immune cells and their immune-related genes (IRGs). However, the mechanism by which IRGs of DRG regulate NP action has not been fully elucidated. Here, we performed Gene Ontology (GO) and the Kyoto Encyclopedia of Genes and Genomes (KEGG) analyses of IRGs in DRG bulk-RNA sequencing data from spared nerve injury (SNI) model mice and found that their IRGs were enriched in many pathways, especially in the immune response pathway. Subsequently, we analyzed single-cell RNA sequencing (scRNA-seq) data from DRGs extracted from the SNI model and identified eight cell populations. Among them, the highest IRG activity was presented in macrophages. Next, we analyzed the scRNA and bulk-sequencing data and deduced five common transcription factors (TFs) from differentially expressed genes (DEGs). The protein-protein interaction (PPI) network suggested that Atf3 and JunB are closely related. In vitro experiments, we verified that the protein and mRNA expressions of Atf3 and JunB were up-regulated in macrophages after lipopolysaccharide (LPS) stimulation. Moreover, the down-regulation of Atf3 reduced the release of inflammatory cytokines and decreased the protein and mRNA expression levels of JunB. The down-regulation of JunB also reduced the release of inflammatory cytokines. Furthermore, overexpression of JunB attenuated the effect of Atf3 down-regulation in reducing the release of inflammatory cytokines. Therefore, we speculated that Atf3 might promote NP through JunB-mediated release of inflammatory factors in DRG macrophages.