BackgroundWe aim to clarify the controversial associations between EBV-related antibodies and gastric cancer risk.MethodsWe analysed the associations between serological Epstein-Barr nuclear antigen 1 immunoglobulin A (EBNA1-IgA) and viral capsid antigen immunoglobulin A (VCA-IgA) by enzyme-linked immunosorbent assay and the risk of gastric cancer in a nested case-control study originated from a population-based nasopharyngeal carcinoma (NPC) screening cohort in Zhongshan, a city of southern China, including 18 gastric cancer cases and 444 controls. Conditional logistic regression was used to calculate the odds ratios (ORs) and corresponding 95% confidence intervals (CIs).ResultsAll the sera of cases were sampled before diagnosis and the median time interval was 3.04 (range: 0.04, 7.59) years. Both increased relative optical density (rOD) values of EBNA1-IgA and VCA-IgA were associated with higher risks of gastric cancer with age adjusted ORs of 1.99 (95%CI: 1.07, 3.70) and 2.64 (95%CI: 1.33, 5.23), respectively. Each participant was further classified as high or medium/low risk based on a combination of two anti-EBV antibody levels. Participants in the high-risk group had substantially higher odds of developing gastric cancer than that in the medium/low risk group with an age adjusted OR of 6.53 (95%CI: 1.69, 25.26).ConclusionsOur research reveals positive associations between EBNA1-IgA and VCA-IgA and gastric cancer risk in southern China. We thus postulate that EBNA1-IgA and VCA-IgA might appear to be potential biomarkers for gastric cancer. More research to further validate the results among diverse populations and investigate its underlying biological mechanism is needed.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12885-023-10994-0.