Despite significant advancements in the treatment of non-small cell lung cancer (NSCLC) through immunotherapy, many patients still exhibit resistance to this approach. This study aims to identify the characteristics of individuals who can benefit from immunotherapy, especially immune checkpoint inhibitors (ICIs), and to investigate optimal strategies for patients who experience resistance to it. Data on gene expression patterns and clinical information from NSCLC patients who underwent immunotherapy were obtained from the Gene Expression Omnibus databases. A predictive signature for immunotherapy prognosis was developed using a training dataset and validated with validation datasets. Immune landscape and immunotherapy responsiveness analyses were conducted to assess the risk signature. Additionally, data from a study on immunotherapy were used to evaluate the correlation between MNX1 mutation and the effectiveness of ICIs, including clinical data and whole exome sequencing data. We identified 7 genes in NSCLC using RNA-seq data that were significantly associated with the efficacy of immunotherapy. Based on these genes, a risk signature was created to predict the efficacy of ICIs. Patients in the low-risk group had better outcomes compared to those in the high-risk group after receiving ICIs. Additionally, our analysis of the immune landscape revealed a significant association between the high-risk signature and an immunosuppressive state. We also discovered an unexpected role of tumor-specific MNX1 and HOXD1 in suppressing the immune response against cancer. Notably, NSCLC patients with MNX1 mutations experienced prolonged progression-free survival. Furthermore, we identified several medications that exhibited increased sensitivity in patients with high MNX1 expression, with topoisomerase inhibitors showing the highest level of sensitivity. This could be a potential strategy to improve the efficacy of ICIs. The risk signature has demonstrated its effectiveness in forecasting the prognosis of NSCLC treated with ICIs, enabling better patient stratification and more accurate prediction of immunotherapy response. Moreover, MNX1 and HOXD1 have been identified as key molecules related to immunotherapy resistance. Inhibition of these molecules, combined with current ICIs, offers novel strategies for the management of NSCLC patients.