Attentional control theory (ACT) posits that elevated anxiety increases the probability of re-allocating cognitive resources needed to complete a task to processing anxiety-related stimuli. This process impairs processing efficiency and can lead to reduced performance effectiveness. Science, technology, engineering, and math (STEM) students frequently experience STEM-related anxiety, which can interfere with learning and performance and negatively impact student retention and graduation rates. The objective of this study was to extend the ACT framework to investigate the neurobiological associations between STEM-related anxiety and cognitive performance among 123 physics undergraduate students. Latent profile analysis (LPA) identified four profiles of student STEM-related anxiety, including two profiles that represented the majority of the sample (Low STEM Anxiety; 59.3% and High Math Anxiety; 21.9%) and two additional profiles that were not well represented (High STEM Anxiety; 6.5% and High Science Anxiety; 4.1%). Students underwent a functional magnetic resonance imaging (fMRI) session in which they performed two tasks involving physics cognition: the Force Concept Inventory (FCI) task and the Physics Knowledge (PK) task. No significant differences were observed in FCI or PK task performance between High Math Anxiety and Low STEM Anxiety students. During the three phases of the FCI task, we found no significant brain connectivity differences during scenario and question presentation, yet we observed significant differences during answer selection within and between the dorsal attention network (DAN), ventral attention network (VAN), and default mode network (DMN). Further, we found significant group differences during the PK task were limited to the DAN, including DAN-VAN and within-DAN connectivity. These results highlight the different cognitive processes required for physics conceptual reasoning compared to physics knowledge retrieval, provide new insight into the underlying brain dynamics associated with anxiety and physics cognition, and confirm the relevance of ACT theory for STEM-related anxiety.