The gut microbiota-brain axis is a complex communication network essential for host health. Any long-term disruption can affect higher cognitive functions, or it may even result in several chronic neurological diseases. The type and diversity of nutrients an individual consumes are essential for developing the gut microbiota (GM) and the brain. Hence, dietary patterns might influence networks communication of this axis, especially at the age that both systems go through maturation processes. By implementing Mutual Information and Minimum Spanning Tree (MST); we proposed a novel combination of Machine Learning and Network Theory techniques to study the effect of animal protein and lipid intake on the connectivity of GM and brain cortex activity (BCA) networks in children from 5-to 10 years old from an indigenous community in the southwest of México. Socio-ecological conditions in this nonwestern lifestyle community are very homogeneous among its inhabitants but it shows high individual heterogeneity in the consumption of animal products. Results suggest that MST, the critical backbone of information flow, diminishes under low protein and lipid intake. So, under these nonwestern regimens, deficient animal protein and lipid consumption diets may significantly affect the GM-BCA connectivity in crucial development stages. Finally, MST offers us a metric that unifies biological systems of different nature to evaluate the change in their complexity in the face of environmental pressures or disturbances. Effect of Diet on gut microbiota and brain networks connectivity.