Constipation is correlated with diminished cognitive function, revealing a possible rectum-brain connection. In this counter-balanced crossover trial, 13 elite triathletes underwent a Stroop test to assess cognitive function and executive control. The Stroop test was conducted both with and without magnesium oxide intake, with a 1-week washout period between sessions. Oxygenation and blood distribution during the cognitive challenge were measured using Near-Infrared Spectroscopy (NIRS). Measurements were taken in both the prefrontal brain and the sub-navel region, where the highest glucose uptake was detected under the 18F-fluorodeoxyglucose Positron Emission Tomography (PET) scan. A significant reduction in completion time for the Stroop test was observed after defecation compared to the non-defecated condition (non-defecation: [27.1 ± 1.1] s; non-magnesium defecation: [24.4 ± 0.9] s; magnesium defecation: [23.4 ± 0.8] s, p textless 0.05). Stroop test performance was improved in all (100%, 13/13) of the participants after magnesium-induced defecation and most (69%, 9/13) of the participants after non-magnesium-induced defecation. While no alterations in oxygenation and blood distribution were observed in the prefrontal brain during the Stroop test, decreased oxygenation levels were observed in the sub-navel region under both defecated conditions, without significant changes in blood distribution (p textless 0.05). This data suggests an acute increase in oxygen consumption at this specific region. The result of this study suggests an unexplored causal link between the state of the rectum and cognitive performance. Magnesium supplementation to improved rectal emptying presents a novel application for optimizing cognitive function in athletes navigating intricate racing conditions.