Gastric cancer (GC) is one of the most frequently diagnosed gastrointestinal cancer types in the world. Novel prognostic biomarkers are required to predict the progression of GC. Glutathione S-transferase Mu (GSTM) belongs to a family of phase II enzymes that have been implicated in a number of cancer types. However, the prognostic value of the GSTM genes has not been previously investigated in GC. The Cancer Genome Atlas (TCGA) was used to evaluate mRNA expression levels of GSTMs in GC tissue samples. Overall survival (OS) rates, hazard ratios (HRs) and 95% CIs were calculated using the Cox logistic regression model and Kaplan-Meier (KM) analysis was performed. In addition, the KM plotter online database was used to validate mRNA expression and the prognostic value of GSMT family members in patients with GC. To predict the function of GSTM genes in these patients, several bioinformatics tools, including the Database for Annotation, Visualization and Integrated Discovery, gene multiple association network integration algorithm, Search Tool for the Retrieval of Interacting Genes/Proteins, Gene Set Enrichment Analysis (GSEA), nomogram and genome-wide co-expression analysis were used. In the present study, high expression of GSTM5 was indicated to be strongly associated with lower OS in patients with GC, according to the TCGA and KM plotter online databases (HR=1.47, 95% CI: 1.06-2.04, P=0.021; and HR=1.69, 95% CI: 1.42-2.01, P=1.6x10-9 , respectively). The results from the GSEA and genome-wide co-expression analysis indicated that GSTM5 expression associated with several biological process terms, including 'adhesion', 'angiogenesis', 'apoptotic process', 'cell growth', 'proliferation', 'migration', 'Hedgehog signaling', 'MAPK signaling' and the 'TGF-β signaling pathway'. In conclusion, the present results indicated that GSTM5 may serve as a biomarker for GC prognosis and may be a potential therapeutic target for GC.