High levels of M2 macrophage infiltration invariably contribute to poor cancer prognosis and can be manipulated by metabolic reprogramming in the tumor microenvironment. However, the metabolism-related genes (MRGs) affecting M2 macrophage infiltration and their clinical implications are not fully understood. In this study, we identified 173 MRGs associated with M2 macrophage infiltration in cases of gastric cancer (GC) using the TCGA and GEO databases. Twelve MRGs were eventually adopted as the prognostic signature to develop a risk model. In the high-risk group, the patients showed poorer survival outcomes than patients in the low-risk group. Additionally, the patients in the high-risk group were less sensitive to certain drugs, such as 5-Fluorouracil, Oxaliplatin, and Cisplatin. Risk scores were positively correlated with the infiltration of multiple immune cells, including CD8+ T cells and M2 macrophages. Furthermore, a difference was observed in the expression and distribution between the 12 signature genes in the tumor microenvironment through single-cell sequencing analysis. In vitro experiments proved that the M2 polarization of macrophages was suppressed by Sorcin-knockdown GC cells, thereby hindering the proliferation and migration of GC cells. These findings provide a valuable prognostic signature for evaluating clinical outcomes and corresponding treatment options and identifying potential targets for GC treatment.