Using quantitative T2* at 7 Tesla (T) magnetic resonance imaging, we investigated whether impairment in selective cognitive functions in multiple sclerosis (MS) can be explained by pathology in specific areas and/or layers of the cortex.Thirty-one MS patients underwent neuropsychological evaluation, acquisition of 7 T multi-echo T2* gradient-echo sequences, and 3 T anatomical images for cortical surfaces reconstruction. Seventeen age-matched healthy subjects served as controls.Cortical T2* maps were sampled at various depths throughout the cortex and juxtacortex. Relation between T2*, neuropsychological scores and a cognitive index (CI), calculated from a principal component analysis on the whole battery, was tested by a general linear model.Cognitive impairment correlated with T2* increase, independently from white matter lesions and cortical thickness, in cortical areas highly relevant for cognition belonging to the default-mode network (p < 0.05 corrected). Dysfunction in different cognitive functions correlated with longer T2* in selective cortical regions, most of which showed longer T2* relative to controls. For most tests, this association was strongest in deeper cortical layers. Executive dysfunction, however, was mainly related with pathology in juxtameningeal cortex. T2* explained up to 20% of the variance of the CI, independently of conventional imaging metrics (adjusted-R2: 52–67%, p < 5.10− 4).Location of pathology across the cortical width and mantle showed selective correlation with impairment in differing cognitive domains. These findings may guide studies at lower field strength designed to develop surrogate markers of cognitive impairment in MS.