To investigate the value of metagenomic Next-Generation Sequencing (mNGS) in diagnosing Pneumocystis jirovecii pneumonia (PJP) in non-human immunodeficiency virus (HIV)-infected patients. In this retrospective study, non-HIV-infected patients with PJP and those diagnosed with non-PJP from August 2022 to December 2024 were selected as subjects. The presence of Pneumocystis jirovecii (PJ) and other co-pathogens in bronchoalveolar lavage fluid (BALF) was analyzed, and the diagnostic efficacy of NGS, polymerase chain reaction (PCR) and serum 1,3-β-D-glucan (BDG) in PJP was compared with the reference standard of clinical compound diagnosis. Eighty-nine non-HIV-infected patients were recruited, with dyspnea as the primary symptom (69.66%) and solid malignant tumor as the most common underlying disease (20.22%). Taking clinical compound diagnosis as the reference standard, the sensitivity, specificity, negative predictive value and positive predictive value of mNGS were higher than those detected by PCR and serum BDG. Among 42 non-HIV-infected patients with PJP who underwent mNGS and conventional pathogen detection of BALF, 6 had simple PJ infection and 36 had combined PJ infection. The detection rate of mNGS in mixed infections was significantly higher than that of conventional pathogen detection (85.71 vs 61.70%, P = 0.012). A total of 127 pathogens were detected in BALF using mNGS, among which fungi had the highest detection rate (46.46%). The fungi, viruses and bacteria detected were mainly Pneumocystis jirovecii, human gammaherpesvirus 4 and Acinetobacter baumannii. mNGS is highly effective in diagnosing non-HIV-infected patients with PJP and exhibits ideal performance in the detection of co-pathogens. In addition, it has certain value for clinical diagnosis and guidance of targeted anti-infective drug treatment.