Healthy diet has been shown to alter brain structure and function and improve cognitive performance, and prior work from our group showed that Mediterranean diet (MeDi) moderates the effect of between-network resting-state functional connectivity (rsFC) on cognitive function in a cross-sectional sample of healthy adults. The current study aimed to expand on this previous work by testing whether MeDi moderates the effects of changes in between- and within-network rsFC on changes in cognitive performance over an average of 5 years. At baseline and 5-year follow up, 124 adults aged 20-80 years underwent resting state fMRI to measure connectivity within and between 10 pre-defined networks, and completed six cognitive tasks to measure each of four cognitive reference abilities (RAs): fluid reasoning (FLUID), episodic memory, processing speed and attention, and vocabulary. Participants were categorized into low, moderate, and high MeDi groups based on food frequency questionnaires (FFQs). Multivariable linear regressions were used to test relationships between MeDi, change in within- and between-network rsFC, and change in cognitive function. Results showed that MeDi group significantly moderated the effects of change in overall between-network and within-network rsFC on change in memory performance. Exploratory analyses on individual networks revealed that interactions between MeDi and between-network rsFC were significant for nearly all individual networks, whereas the moderating effect of MeDi on the relationship between within-network rsFC change and memory change was limited to a subset of specific functional networks. These findings suggest healthy diet may protect cognitive function by attenuating the negative effects of changes in connectivity over time. Further research is warranted to understand the mechanisms by which MeDi exerts its neuroprotective effects over the lifespan.