Gastric cancer (GC) is the second leading cause of tumor-associated death and the fourth most commonly seen tumor across the world. Abnormal ncRNAs have been verified to be involved in potential metastasis via modulating epithelial-to-mesenchymal transition progression and are vital for the progression of cancers. Tumor-infiltrating immune cells (TICs) are a vital indicator of whether cancer patients will benefit from immunotherapy. Nonetheless, the association between ceRNAs and immune cells remained largely unclear. We used the ceRNA network combined with TICs for the prediction of the clinical outcome of GC patients based on TCGA datasets. The percentage of immunocytes in GC was speculated by the use of CIBERSORT. Via Lasso and multivariate assays, prognostic models were established applying survival-related genes and immune cells. Nomograms were developed, and the accuracy of the nomograms was determined using calibration curves. The association between ceRNAs and TICs was validated by the use of integration analysis. In this study, there were 2219 mRNAs (1308 increased and 911 decreased), 171 lncRNAs (51 decreased and 120 increased), and 123 miRNAs (55 decreased and 68 increased) differentially expressed between tumor groups and nontumor groups. Five lncRNAs, six miRNAs, and 64 mRNAs were used for ceRNA network construction. Eight genes including LOX, SPARC, MASTL, PI15, BMPR1B, ANKRD13B, PVT1, and miR-7-5p were applied for the development of the prognostic model. Survival assays suggested that tumor cases with high risk exhibited a shorter overall survival. In addition, we included T-cell CD4 memory activated, monocytes, and neutrophils for the development of a prognosis model. Eventually, our team demonstrated the possible associations between the ceRNA prognosis model and prognostic model based on immune cells. To sum up, the ceRNA network could be used for gene regulation and predict clinical outcomes of GC patients.