Nutritional interventions targeting the microbiota–gut–brain axis are proposed to modulate stress‐induced dysfunction of physiological processes and brain development. Maternal separation (MS) in rats induces long‐term alterations to behaviour, pain responses, gut microbiome and brain neurochemistry. In this study, the effects of dietary interventions (milk fat globule membrane [MFGM] and a polydextrose/galacto‐oligosaccharide prebiotic blend) were evaluated. Diets were provided from postnatal day 21 to both non‐separated and MS offspring. Spatial memory, visceral sensitivity and stress reactivity were assessed in adulthood. Gene transcripts associated with cognition and stress and the caecal microbiota composition were analysed. MS‐induced visceral hypersensitivity was ameliorated by MFGM and to greater extent with the combination of MFGM and prebiotic blend. Furthermore, spatial learning and memory were improved by prebiotics and MFGM alone and with the combination. The prebiotic blend and the combination of the prebiotics and MFGM appeared to facilitate return to baseline with regard to HPA axis response to the restraint stress, which can be beneficial in times where coping mechanisms to stressful events are required. Interestingly, the combination of MFGM and prebiotic reduced the long‐term impact of MS on a marker of myelination in the prefrontal cortex. MS affected the microbiota at family level only, while MFGM, the prebiotic blend and the combination influenced abundance at family and genus level as well as influencing beta‐diversity levels. In conclusion, intervention with MFGM and prebiotic blend significantly impacted the composition of the microbiota as well as ameliorating some of the long‐term effects of early‐life stress.