Dopaminergic signaling in striatum is strongly implicated in executive functions including cognitive flexibility. However, there is a paucity of multimodal research in humans defining the nature of relationships between endogenous dopamine, striatal network activity, and cognition. Here, we measured dopamine synthesis capacity in young and older adults using the PET tracer 6-[18F]fluoro-l-m-tyrosine and examined its relationship with cognitive performance and functional connectivity during an fMRI study of task switching. Aging is associated with alteration in dopamine function, including profound losses in dopamine receptors but an apparent elevation in dopamine synthesis. A compensatory benefit of upregulated dopamine synthesis in aging has not been established. Across young and older adults, we found that cognitive flexibility (low behavioral switch cost) was associated with stronger task-related functional connectivity within canonical fronto-striato-thalamic circuits connecting left inferior frontal gyrus, dorsal caudate nucleus (DCA) and ventral lateral/ventral anterior thalamic nuclei. In young adults, functional connectivity mediated the influence of DCA dopamine synthesis capacity on switch cost. For older adults, these relationships were modified such that DCA synthesis capacity and connectivity interacted to influence switch cost. Older adults with most elevated synthesis capacity maintained the pattern of connectivity–cognition relationships observed in youth, whereas these relationships were not evident for older adults with low synthesis capacity. Together, these findings suggest a role of dopamine in tuning striatal circuits to benefit executive function in young adults and clarify the functional impact of elevated dopamine synthesis capacity in aging.