The gastrointestinal (GI) tract hosts a complex microbiota that plays a crucial role in maintaining health and contributing to disease, including cancer. This narrative review explores the role of gut microbiota in driving epigenetic modifications associated with GI cancers. We highlight key bacterial phyla such as Firmicutes, Bacteroidetes, Actinobacteria, Proteobacteria, and Fusobacteria, and explain how their representative species, including Fusobacterium nucleatum, Bacteroides fragilis, Lactobacillus sp., and Escherichia coli, influence host gene expression through mechanisms such as DNA methylation, histone modification, and regulation of non-coding RNAs. Microbial metabolites, including short-chain fatty acids (SCFAs) like butyrate and secondary bile acids, affect the activity of epigenetic regulators such as DNA methyltransferases and histone deacetylases and have been implicated in the development of colorectal, gastric, liver, pancreatic, and esophageal cancers. By integrating recent scientific findings, this review underscores the potential of targeting microbiota-driven epigenetic pathways to improve prevention and treatment strategies for GI cancers.