Natural killer (NK) cells play essential roles in the tumor development, diagnosis, and prognosis of tumors. In this study, we aimed to establish a reliable signature based on marker genes in NK cells, thus providing a new perspective for assessing immunotherapy and the prognosis of patients with gastric cancer (GC). We analyzed a total of 1560 samples retrieved from the public database. We performed a comprehensive analysis of single-cell RNA-sequencing (scRNA-seq) data of gastric cancer and identified 377 marker genes for NK cells. By performing Cox regression analysis, we established a 12-gene NK cell-associated signature (NKCAS) for the Cancer Genome Atlas (TCGA) cohort, that assigned GC patients into a low-risk group (LRG) or a high-risk group (HRG). In the TCGA cohort, the areas under curve (AUC) value were 0.73, 0.81, and 0.80 at 1, 3, and 5 years. External validation of the predictive ability for the signature was then validated in the Gene Expression Omnibus (GEO) cohorts (GSE84437). The expression levels of signature genes were measured and validated in GC cell lines by real-time PCR. Moreover, NKCAS was identified as an independent prognostic factor by multivariate analysis. We combined this with a variety of clinicopathological characteristics (age, M stage, and tumor grade) to construct a nomogram to predict the survival outcomes of patients. Moreover, the LRG showed higher immune cell infiltration, especially CD8+ T cells and NK cells. The risk score was negatively associated with inflammatory activities. Importantly, analysis of the independent immunotherapy cohort showed that the LRG had a better prognosis and immunotherapy response when compared with the HRG. The identification of NK cell marker genes in this study suggests potential therapeutic targets. Additionally, the developed predictive signatures and nomograms may aid in the clinical management of GC.