Approximately 80 to 90% of patients with gastric cancer (GC) eventually develop into metastatic GC nowadays,because GC is difficult to be diagnosed at an early stage. GC patients with metastases typically have a poor prognosis. It is necessary to explore a potential prognostic marker in metastatic GC. All GC data were obtained from The Cancer Genome Atlas and Gene Expression Omnibus databases. The metastasis-related candidate gene and its role in GC were analyzed by comprehensive analysis. Totally 1049 metastasis-related genes were identified in GC. Univariate Cox regression analysis screened the top 10 genes (PDHX, SLC43A1, CSAG2, NT5DC2, CSAG1, FMN1, MED1, HIVEP2, FNDC3A, and PPP1R2) that were closely correlated with prognosis of GC patients. Among which, NT5DC2 was screened as the target gene for subsequent study. The NT5DC2 expression were increased in primary GC and metastatic GC samples. Moreover, GC patients with high NT5DC2 expression exhibited shorter overall survival and post progression survival, and the NT5DC2 was metastatic GC patients' independent prognostic factor. Totally 29 pathways were activated in metastatic GC samples with high NT5DC2 expression. Four immune cells' infiltration were significantly different between NT5DC2 high and low expressed metastatic GC patients. NT5DC2 showed significantly negative correlations with 6 types of immune cells' critical marker genes and 5 types of immune cell infiltration. The 10 immune checkpoint expressions were decreased in high NTDC2 expression metastatic GC patients. NT5DC2 plays a prognostic role in metastatic GC. GC patients with high NT5DC2 expression indicates unfavorable prognosis.