Ferroptosis is a regulated form of cell death that involves iron-dependent lipid peroxidation. Ferroptosis-related genes (FRGs) play an essential role in the tumorigenesis of gastric cancer (GC), which is one of the most common and lethal cancers worldwide. Understanding the prognostic significance of FRGs in GC can shed light on GC treatment and diagnosis. In this study, we proposed a new gene co-expression network analysis method, namely EP-WGCNA. This method used Euclidean and Pearson weighted distance (EP_dis) to construct a weighted gene co-expression network instead of the Pearson’s correlation coefficient used in the original WGCNA method. The aim was to better capture the interactions and functional associations among genes. We used EP-WGCNA to identify the FRGs related to GC phenotype and applied bioinformatics methods to select the FRGs associated with the prognosis (P-FRGs) of GC patients. Firstly, we screened the FRGs that were differentially expressed based on the TCGA and GTEx databases. Then, we selected the P-FRGs using EP-WGCNA, Cox regression, and Kaplan–Meier analysis. The prognostic model based on P-FRGs-Cox (ALB, BNIP3, DPEP1, GLS2, MEG3, PDK4, TF, and TSC22D3) was constructed on the TCGA-GTEx dataset. According to the median risk score, all patients in the TCGA training dataset and GSE84426 testing dataset were classified into a high- or low-risk group. GC patients in the low-risk group showed higher survival probability than those in the high-risk group. The time-dependent receiver operating characteristic (timeROC) showed that EP-WGCNA-Cox predicted 0.77 in the training set and 0.64 in the testing set for the 5-year survival rate of GC patients, which was better than traditional WGCNA-Cox (P-WGCNA-Cox). In addition, we validated that the P-FRGs were significantly differentially expressed in the adjacent non-tumor gastric tissues and tumor tissues by immunohistochemical staining from the Human Protein Atlas (HPA) database. We also found that the P-FRGs were enriched in tumorigenic pathways by enrichment analysis. In conclusion, our study demonstrated that EP-WGCNA can mine the key FRGs related to the phenotype of GC and is superior to the P-WGCNA. The EP-WGCNA-Cox model based on P-FRGs is reliable in predicting the survival rate of GC patients and can provide potential biomarkers and therapeutic targets for GC.