The human gastrointestinal tract employs an assortment of chemical, enzymatic and immune barriers to impede pathogen colonization. An essential component of these barriers is the gut microbiota, which infers protection against ingested pathogens through its colonization resistance mechanisms. Specifically, the gut microbiota of the distal small intestine (ileum) renders a crucial line of defense, given that this location is regarded as an important interaction site. This study aimed to evaluate the impact of the ileal microbiota on the survival of the foodborne pathogens Salmonella enterica serotype Typhimurium and Listeria monocytogenes, utilizing an in vitro digestion model system. Moreover, the effect of diet on the gut microbiota colonization resistance mechanisms was assessed, by comparing a healthy (high fiber/low sugar) and a western diet (low fiber/high sugar). For S. Typhimurium, the results revealed that the digestion of a healthy diet led to a similar inactivation compared to the western diet, with the values of total log reduction being 0.83 and 0.82 log(CFU), respectively; yet the lack of readily accessible nutrients in the healthy diet combined with the acidic shock during gastric digestion caused the induction of stress tolerance to the pathogen. This resulted in increased pathogen survival in the presence of gut microbiota, with S. Typhimurium proliferating during the ileal phase with a maximum specific growth rate of 0.16 1/h. On the contrary, for L. monocytogenes, the healthy diet was associated with a greater inactivation than the western diet (total log reduction values: 3.08 and 1.30 log(CFU), respectively), which appeared strongly influenced by the encounter of the pathogen with the gut microbiota. Regarding the latter, the species Escherichia coli and Bacteroides thetaiotaomicron appeared to be the most prevalent in most cases. Finally, it was also demonstrated that the ileal microbiota colonization resistance mechanisms largely relied on competitive responses. The obtained knowledge of this research can contribute to the development and/or complementation of defensive strategies against pathogen infection, while also underlining the value of in vitro approaches.