Anxiety about math is tied to low math grades and standardized test scores, yet not all math-anxious individuals perform equally poorly in math. We used functional magnetic resonance imaging to separate neural activity during the anticipation of doing math from activity during math performance itself. For higher (but not lower) math-anxious individuals, increased activity in frontoparietal regions when simply anticipating doing math mitigated math-specific performance deficits. This network included bilateral inferior frontal junction, a region involved in cognitive control and reappraisal of negative emotional responses. Furthermore, the relation between frontoparietal anticipatory activity and highly math-anxious individuals' math deficits was fully mediated (or accounted for) by activity in caudate, nucleus accumbens, and hippocampus during math performance. These subcortical regions are important for coordinating task demands and motivational factors during skill execution. Individual differences in how math-anxious individuals recruit cognitive control resources prior to doing math and motivational resources during math performance predict the extent of their math deficits. This work suggests that educational interventions emphasizing control of negative emotional responses to math stimuli (rather than merely additional math training) will be most effective in revealing a population of mathematically competent individuals, who might otherwise go undiscovered.