Despite effective antiretroviral therapy, cognitive impairment remains prevalent among people with HIV (PWH) and decrements in executive function are particularly prominent. One component of executive function is cognitive flexibility, which integrates a variety of executive functions to dynamically adapt one's behavior in response to changing contextual demands. Though substantial work has illuminated HIV-related aberrations in brain function, it remains unclear how the neural oscillatory dynamics serving cognitive flexibility are affected by HIV-related alterations in neural functioning. Herein, 149 participants (PWH: 74; seronegative controls: 75) between the ages of 29–76 years completed a perceptual feature matching task that probes cognitive flexibility during high-density magnetoencephalography (MEG). Neural responses were decomposed into the time-frequency domain and significant oscillatory responses in the theta (4–8 Hz), alpha (10–16 Hz), and gamma (74–98 Hz) spectral windows were imaged using a beamforming approach. Whole-brain voxel-wise comparisons were then conducted on these dynamic functional maps to identify HIV-related differences in the neural oscillatory dynamics supporting cognitive flexibility. Our findings indicated group differences in alpha oscillatory activity in the cingulo-opercular cortices, and differences in gamma activity were found in the cerebellum. Across all participants, alpha and gamma activity in these regions were associated with performance on the cognitive flexibility task. Further, PWH who had been treated with antiretroviral therapy for a longer duration and those with higher current CD4 counts had alpha responses that more closely resembled those of seronegative controls, suggesting that optimal clinical management of HIV infection is associated with preserved neural dynamics supporting cognitive flexibility.