Gastric cancer is one of the most malignant types of cancer in the digestive system because of its high incidence and mortality. There is a notable association between gastric cancer progression and the level and sort of immune cells infiltrating the tumor microenvironment. First, 41 up-regulated differentially expressed genes (DEGs) and 91 down-regulated DEGs were identified from the Gene Expression Omnibus (GEO) database. Among the 21 core genes, prognosis biomarkers FAP, ASPN and CTHRC1 were identified for further study via Kaplan-Meier Plotter, with FAP having the highest prognostic value among them. In addition, the ROC curves of FAP (AUC=0.992), ASPN (AUC=0.955) and CTHRC1 (AUC=0.983) also showed high diagnostic value. Then the expression and mutation levels of the biomarkers were verified by GEPIA and cBioPortal. Their high expression levels were closely correlated to the clinical stages and metastasis status of gastric cancer. Furthermore, their expression was strongly relevant to immune infiltration and macrophage marker levels. In drug response analysis, gastric cancer cell lines with overexpression of FAP and ASPN were more sensitive to PI3K and MET inhibitors, respectively. Importantly, the meta-analysis showed that FAP had an overall positive rate of 68 % (63-73 %, 95 % CI; n=382) and the patients with high expression of FAP showed a poor prognosis in terms of OS (HR=1.82, 1.33-2.48, 95 % CI) in gastric cancer. In short, FAP, ASPN and CTHRC1 were identified as potential prognostic and diagnostic biomarkers related with immunity and might be effective therapeutic targets of gastric cancer, and the significance of FAP for the prognosis was further assessed by meta-analysis.