Nutritional intake can promote early neonatal brain development in very preterm born neonates (< 32 weeks’ gestation). In a group of 7-year-old very preterm born children followed since birth, we examined whether early nutrient intake in the first weeks of life would be associated with long-term brain function and neurocognitive skills at school age. Children underwent resting-state functional MRI (fMRI), intelligence testing (Wechsler Intelligence Scale for Children, 5th Ed) and visual-motor processing (Beery-Buktenica, 5th Ed) at 7 years. Relationships were assessed between neonatal macronutrient intakes, functional connectivity strength between thalamic and default mode networks (DMN), and neuro-cognitive function using multivariable regression. Greater functional connectivity strength between thalamic networks and DMN was associated with greater intake of protein in the first week (β = 0.17; 95% CI 0.11, 0.23, p < 0.001) but lower intakes of fat (β = − 0.06; 95% CI − 0.09, − 0.02, p = 0.001) and carbohydrates (β = − 0.03; 95% CI − 0.04, − 0.01, p = 0.003). Connectivity strength was also associated with protein intake during the first month (β = 0.22; 95% CI 0.06, 0.37, p = 0.006). Importantly, greater thalamic-DMN connectivity strength was associated with higher processing speed indices (β = 26.9; 95% CI 4.21, 49.49, p = 0.02) and visual processing scores (β = 9.03; 95% CI 2.27, 15.79, p = 0.009). Optimizing early protein intake may contribute to promoting long-term brain health in preterm-born children.