Enteric pathogens sense the complex chemistry within the gastrointestinal tract to efficiently compete with the resident microbiota and establish a colonization niche. Here, we show that enterohaemorrhagic Escherichia coli and Citrobacter rodentium, its surrogate in a mouse infection model, sense galacturonic acid to initiate a multi-layered program towards successful mammalian infection. Galacturonic acid utilization as a carbon source aids the initial pathogen expansion. The main source of galacturonic acid is dietary pectin, which is converted to galacturonic acid by the prominent member of the microbiota, Bacteroides thetaiotamicron. This is regulated by the ExuR transcription factor. However, galacturonic acid is also sensed as a signal through ExuR to modulate the expression of the genes encoding a molecular syringe known as a type III secretion system, leading to infectious colitis and inflammation. Galacturonic acid acts as both a nutrient and a signal directing the exquisite microbiota-pathogen relationships within the gastrointestinal tract. This work highlights that differential dietary sugar availability influences the relationship between the microbiota and enteric pathogens, as well as disease outcomes.