Gastric cancer (GC) has a great fatality rate, meanwhile, there is still a lack of available biomarkers for prognosis. The goal of the research was to discover key and novel potential biomarkers for GC. We screened for the expression of significantly altered genes based on survival rates from two consensus molecular subtypes (CMS) of GC. Subsequently, functional enrichment analysis showed these genes involved in many cancers. And we picked 6 hub genes that could both secreted in the tumor microenvironment and expression enhanced in immune cells. Then, Kaplan Meier survival and expression detected in the tumor pathological stage were utilized to clarify the prognostic of these 6 hub genes. The results indicated that OGN, CHRDL2, C2orf40, THBS4, CHRDL1, and ANGPTL1, respectively, were significantly associated with poor OS in GC patients. And their expression increased with cancer advanced. Moreover, immune infiltration analysis displayed that those hub genes expression positively with M2 macrophage, CD8+ T Cell, most immune inhibitors, and majority immunostimulators. In summary, our results suggested that OGN, CHRDL2, C2orf40, THBS4, CHRDL1, and ANGPTL1 were all potential biomarkers for GC prognosis and might also be potential therapeutic targets for GC.