As individuals age, they may experience a decline in gait automaticity, which requires increased attentional resources for the control of gait. This age-related decline in gait automaticity has been shown to contribute to higher prefrontal cortex (PFC) activation and lower dual-task performance during dual-task walking in older adults. This study is to investigate the effect of treadmill walking on PFC activation and dual-task performance in older adults. A total of 20 older adults (mean age, 64.35 ± 2.74 years) and 20 younger adults (mean age, 30.00 ± 3.15 years) performed single- and dual-task walking in overground and treadmill conditions. A wearable functional near-infrared spectroscopy and gait analyzer were used to analyze PFC activation and dual-task performance, respectively. To determine the dual-task (gait and cognitive) performance, the dual-task cost (DTC) was calculated using the following formula: (single-task − dual-task)/single-task × 100. In both groups, dual-task treadmill walking led to reduced PFC activation and reduced DTC compared to dual-task overground walking. Furthermore, despite a higher DTC in gait variability, correct response, total response, response index and a higher error score in older adults than in younger adults during overground walking, there was no difference in treadmill walking. The difference in PFC activation between single- and dual-tasks was also observed only in overground walking. Performing dual-task walking on a treadmill compared to overground walking results in different levels of dual-task performance and PFC activity. Specifically, older adults are able to maintain similar levels of dual-task performance as younger adults while walking on a treadmill, with reduced PFC activation due to the automaticity induced by the treadmill. Therefore, older adults who exhibit low dual-task performance during overground walking may be able to improve their performance while walking on a treadmill with fewer attentional resources.