Testicular dysfunction (TDF) is characterized by testosterone deficiency and is caused by oxidative stress injury in Leydig cells. A natural fatty amide named N-benzylhexadecanamide (NBH), derived from cruciferous maca, has been shown to promote testosterone production. Our study aims to reveal the anti-TDF effect of NBH and explore its potential mechanism in vitro. This study examined the effects of H2O2on cell viability and testosterone levels in mouse Leydig cells (TM3) under oxidative stress. In addition, cell metabolomics analysis based on UPLC-Q-Exactive-MS/MS showed that NBH was mainly involved in arginine biosynthesis, aminoacyl-tRNA biosynthesis, phenylalanine, tyrosine and tryptophan biosynthesis, the TCA cycle and other metabolic pathways by affecting 23 differential metabolites, including arginine and phenylalanine. Furthermore, we also performed network pharmacological analysis to observe the key protein targets in NBH treatment. The results showed that its role was to up-regulate ALOX5, down-regulate CYP1A2, and play a role in promoting testicular activity by participating in the steroid hormone biosynthesis pathway. In summary, our study not only provides new insights into the biochemical mechanisms of natural compounds in the treatment of TDF, but also provides a research strategy that integrates cell metabolomics and network pharmacology in order to promote the screening of new drugs for the treatment of TDF.