Glioblastoma (GBM) is one of the most malignant primary brain tumors in adults. The NPC2 gene (Niemann-Pick type C intracellular cholesterol transporter 2) is a protein-coding gene with a lipid recognition domain. The NPC2 gene was found to be significantly increased in gliomas (LGG and GBM), and it is now thought to be a risk factor. COX analysis demonstrated that NPC2 was a significant risk factor for glioma. Functional enrichment analysis of genes that were differentially expressed between high and low expression groups revealed that genes were primarily enriched in the regulation of trans-synaptic signaling, Retrograde endocannabinoid signaling and other pathways. According to the findings of the immunoinfiltration investigation, the NPC2 gene and macrophage, DC, etc. have a strong positive association. In addition, patients with high NPC2 expression had higher levels of immune cell expression. Medication sensitivity research revealed that NPC2's differential expression had some bearing on patients' medication sensitivity. There was a strong correlation between the prognosis of glioma patients and the gene sets NUDT19 and NUME. In brief, the NPC2 gene was identified to be a possible biomarker of glioma, and preliminary analysis was done on the role of the NPC2 gene in immunological microenvironment of glioma.