Whether brain matter volume is correlated with cognitive functioning and higher intelligence is controversial. We explored this relationship by analysis of data collected on 193 healthy young and older adults through the "Leipzig Study for Mind-Body-Emotion Interactions" (LEMON) study. Our analysis involved four cognitive measures: fluid intelligence, crystallized intelligence, cognitive flexibility, and working memory. Brain subregion volumes were determined by magnetic resonance imaging. We normalized each subregion volume to the estimated total intracranial volume and conducted training simulations to compare the predictive power of normalized volumes of large regions of the brain (i.e., gray matter, cortical white matter, and cerebrospinal fluid), normalized subcortical volumes, and combined normalized volumes of large brain regions and normalized subcortical volumes. Statistical tests showed significant differences in the performance accuracy and feature importance of the subregion volumes in predicting cognitive skills for young and older adults. Random forest feature selection analysis showed that cortical white matter was the key feature in predicting fluid intelligence in both young and older adults. In young adults, crystallized intelligence was best predicted by caudate nucleus, thalamus, pallidum, and nucleus accumbens volumes, whereas putamen, amygdala, nucleus accumbens, and hippocampus volumes were selected for older adults. Cognitive flexibility was best predicted by the caudate, nucleus accumbens, and hippocampus in young adults and caudate and amygdala in older adults. Finally, working memory was best predicted by the putamen, pallidum, and nucleus accumbens in the younger group, whereas amygdala and hippocampus volumes were predictive in the older group. Thus, machine learning predictive models demonstrated an age-dependent association between subcortical volumes and cognitive measures. These approaches may be useful in predicting the likelihood of age-related cognitive decline and in testing of approaches for targeted improvement of cognitive functioning in older adults.