It is unclear whether neurotoxicity due to the antiretroviral drug efavirenz (EFV) results in neurocognitive impairment in people living with HIV (PLWH). Previously, we found that discontinuing EFV was associated with improved processing speed and attention on neuropsychological assessment. In this imaging study, we investigate potential neural mechanisms underlying this cognitive improvement using a BOLD fMRI task assessing cortical and subcortical functioning. Asymptomatic adult PLWH stable on emtricitabine/tenofovirdisoproxil/efavirenz were randomly (1:2) assigned to continue their regimen (n = 12) or to switch to emtricitabine/tenofovirdisoproxil/rilpivirine (n = 28). At baseline and after 12weeks, both groups performed the Stop-Signal Anticipation Task, which tests reactive and proactive inhibition (indicative of subcortical and cortical functioning, respectively), involving executive functioning, working memory, and attention. Behavior and BOLD fMRI activation levels related to processing speed and attention Z-scores were assessed in 17 pre-defined brain regions. Both groups had comparable patient and clinical characteristics. Reactive inhibition behavioral responses improved for both groups on week12, with other responses unchanged. Between-group activation did not differ significantly. For reactive inhibition, positive Pearson coefficients were observed for the change in BOLD fMRI activation levels and change in processing speed and attention Z-scores in all 17 regions in participants switched to emtricitabine/tenofovir disoproxil/rilpivirine, whereas in the control group, negative correlation coefficients were observed in 10/17 and 13/17 regions, respectively. No differential pattern was observed for proactive inhibition. Potential neural mechanisms underlying cognitive improvement after discontinuing EFV in PLWH were found in subcortical functioning, with our findings suggesting that EFV's effect on attention and processing speed is, at least partially, mediated by reactive inhibition. Clinicaltrials.gov identifier [NCT02308332].