Endogenous pain inhibition is less efficient in chronic pain patients. Diffuse noxious inhibitory control (DNIC), a form of endogenous pain inhibition, is compromised in women and older people, making them more vulnerable to chronic pain. However, the underlying mechanisms remain unclear. Here, we used a capsaicin-induced DNIC test and resting state functional MRI to investigate the impact of aging and sex on endogenous pain inhibition and associated brain circuitries in healthy rats. We found that DNIC was less efficient in young females compared to young males. DNIC response was lost in old rats of both sexes, but the brain networks engaged during DNIC differed in a sex-dependent manner. Young males had the most efficient analgesia with the strongest connectivity between anterior cingulate cortex (ACC) and periaqueductal gray (PAG). The reduced efficiency of DNIC in young females appeared to be driven by a widespread brain connectivity. Old males showed increased connectivity between PAG, raphe nuclei, pontine reticular nucleus and hippocampus, which may not be dependent on connections to ACC, while old females showed increased connectivity between ACC, PAG and more limbic regions. These findings suggest that distinct brain circuitries including the limbic system may contribute to higher susceptibility to pain modulatory deficits in the elderly population, and sex may be a risk factor for developing age-related chronic pain.