Background: Dopaminergic medication improves gait in people with Parkinson disease (PD). However, it remains unclear if dopaminergic medication modulates cortical activity while walking. Objective: We investigated the effects of dopaminergic medication on cortical activity during unobstructed walking and obstacle avoidance in people with PD. Methods: A total of 23 individuals with PD, in both off (PDOFF) and on (PDON) medication states, and 30 healthy older adults (control group [CG]) performed unobstructed walking and obstacle avoidance conditions. Cortical activity was acquired through a combined functional near-infrared spectroscopy electroencephalography (EEG) system, along with gait parameters, through an electronic carpet. Prefrontal cortex (PFC) oxygenated hemoglobin (HbO2) and EEG absolute power from FCz, Cz, and CPz channels were calculated. Results: HbO2 concentration reduced for people with PDOFF during obstacle avoidance compared with unobstructed walking. In contrast, both people with PDON and the CG had increased HbO2 concentration when avoiding obstacles compared with unobstructed walking. Dopaminergic medication increased step length, step velocity, and β and γ power in the CPz channel, regardless of walking condition. Moreover, dopaminergic-related changes (ie, on-off) in FCz/CPz γ power were associated with dopaminergic-related changes in step length for both walking conditions. Conclusions: PD compromises the activation of the PFC during obstacle avoidance, and dopaminergic medication facilitates its recruitment. In addition, PD medication increases sensorimotor integration during walking by increasing posterior parietal cortex (CPz) activity. Increased γ power in the CPz and FCz channels is correlated with step length improvements achieved with dopaminergic medication during unobstructed walking and obstacle avoidance in PD.