Abstract Gastric cancer (GC) remains a predominant form of malignant tumor globally, necessitating innovative non-surgical therapeutic approaches. This investigation aimed to delineate the expression landscape of macrophage-associated genes in GC and to evaluate their prognostic significance and influence on immunotherapeutic responsiveness. Utilizing the CellMarker2.0 database, we identified 69 immune cell markers with prognostic relevance in GC, including 12 macrophage-specific genes. A Weighted Gene Co-Expression Network Analysis (WGCNA) isolated 3,181 genes correlated with these macrophage markers. The Cancer Genome Atlas (TCGA-STAD) dataset was employed as the training set, while data from the GSE62254 served as the validation cohort. 13 genes were shortlisted through LASSO-Cox regression to formulate a prognostic model. Multivariable Cox regression substantiated that the calculated risk score serves as an imperative independent predictor of overall survival (OS). Distinct macrophage infiltration profiles, pathway associations, treatment susceptibilities, and drug sensitivities were observed between high- and low-risk groups. The preliminary validation of ANXA5 in predicting the survival rates of GC patients at 1 year, 3 years, and 5 years, as well as its expression levels were higher and role in promoting tumor angiogenesis in GC through immunohistochemistry and angiogenesis experiments. In summary, macrophage-related genes were potentially a novel crosstalk mechanism between macrophages and endothelial cells in the tumor microenvironment, and the interplay between inflammation and angiogenesis might have also offered new therapeutic targets, providing a new avenue for personalized treatment interventions.