Cognitive flexibility represents the capacity to switch among different mental schemes, providing an adaptive advantage to a changing environment. The neural underpinnings of this executive function have been deeply studied in humans through fMRI, showing that the left inferior frontal cortex (IFC) and the left inferior parietal lobe (IPL) are crucial. Here, we investigated the inhibitory-excitatory balance in these regions by means of γ-aminobutyric acid (GABA+) and glutamate + glutamine (Glx), measured with magnetic resonance spectroscopy (MRS), during a cognitive flexibility task and its relationship with performance level and the local task-induced blood-oxygen level dependent (BOLD) response in 40 young (18-35 y.o.; 26 female) and 40 older (18-35 y.o.; 21 female) human adults. As the IFC and the IPL are richly connected regions, we also examined whole-brain effects associated with their local metabolic activity. Results did not show absolute metabolic modulations associated with flexibility performance, but performance level was related to the direction of metabolic modulation in the IPL with opposite patterns in young and older individuals. The individual inhibitory-excitatory balance modulation showed an inverse relationship with the local BOLD response in the IPL. Finally, the modulation of inhibitory-excitatory balance in IPL was related to whole-brain effects only in older individuals. These findings show disparities in the metabolic mechanisms underlying cognitive flexibility in young and older adults and their association with performance level and BOLD response. Such metabolic differences are likely to play a role in executive functioning during aging and specifically in cognitive flexibility.Significance Statement Cognitive flexibility provides an advantage in adapting to changing environments. We investigated the inhibitory-excitatory balance (GABA+/Glx) modulation in the frontal and parietal cortices during cognitive flexibility in young and older individuals through MRS. An increase in the excitatory tone during cognitive performance related to a better execution in younger adults. Interestingly, it was an increase in the inhibitory tone that was associated to a better performance in older adults. Furthermore, we revealed that an increased inhibitory tone in older adults related to a decreased oxygen consumption in remote brain areas (BOLD-fMRI). This may suggest that GABA modulation facilitates the segregation of neural networks, maximizing brain efficiency and cognitive performance. These findings underscore age-related disparities in the neurometabolic mechanisms underlying cognitive flexibility.