Intervertebral disc degeneration (IDD) is considered one of the main causes of low back pain and lumbar disc herniation. Various studies have shown that disc cell senescence plays a critical role in this process. however, its role in IDD is yet unclear. In this study, we explored the role of senescence-related genes (SR-DEGs) and its underlying mechanism in IDD. A total of 1325 differentially expressed genes (DEGs) were identified using Gene Expression Omnibus (GEO) database GSE41883. 30 SR-DEGs were identified for further functional enrichment and pathway analysis, and two hub SR-DEGs (ERBB2 and PTGS2) were selected to construct transcription factor (TF)–gene interaction and TF-miRNA coregulatory networks, and 10 candidate drugs were screened for the treatment of IDD. Last but not least, in vitro experiments show that ERBB2 expression decreased and PTGS2 expression increased in human nucleus pulposus (NP) cell senescence model treated with TNF-α. After lentivirus-mediated overexpression of ERBB2, the expression of PTGS2 decreased and the senescence level of NP cells decreased. Overexpression of PTGS2 reversed the anti-senescence effects of ERBB2. The findings in this study suggested that ERBB2 overexpression further reduced NP cell senescence by inhibiting PTGS2 levels, which ultimately alleviated IDD. Taken together, our findings provide new insights into the roles of senescence-related genes in IDD and highlight a novel target of ERBB2-PTGS2 axis for therapeutic strategies.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12891-023-06625-1.