Identifying novel mechanisms underlying dementia is critical to improving prevention and treatment. As an approach to mechanistic discovery, we investigated whether MIND diet (Mediterranean-DASH Diet Intervention for Neurodegenerative Delay), a consistent risk factor for dementia, is correlated with a specific profile of cortical gene expression, and whether such a transcriptomic profile is associated with dementia, in the Religious Orders Study (ROS) and Rush Memory and Aging Project (MAP). RNA sequencing (RNA-Seq) was conducted in postmortem dorsolateral prefrontal cortex tissue from 1,204 deceased participants; neuropsychological assessments were performed annually prior to death. In a subset of 482 participants, diet was assessed ~6 years before death using a validated food-frequency questionnaire; in these participants, using elastic net regression, we identified a transcriptomic profile, consisting of 50 genes, significantly correlated with MIND diet score (P=0.001). In multivariable analysis of the remaining 722 individuals, higher transcriptomic score of MIND diet was associated with slower annual rate of decline in global cognition (β=0.011 per standard deviation increment in transcriptomic profile score, P=0.003) and lower odds of dementia (odds ratio [OR] =0.76, P=0.0002). Cortical expression of several genes appeared to mediate the association between MIND diet and dementia, including TCIM, whose expression in inhibitory neurons and oligodendrocytes was associated with dementia in a subset of 424 individuals with single-nuclei RNA-seq data. In a secondary Mendelian randomization analysis, genetically predicted transcriptomic profile score was associated with dementia (OR=0.93, P=0.04). Our study suggests that associations between diet and cognitive health may involve brain molecular alterations at the transcriptomic level. Investigating brain molecular alterations related to diet may inform the identification of novel pathways underlying dementia.