In China, high-rise residential communities have increasingly become the primary living mode in recent years. However, issues within the residential environment can still significantly impact mental health. The relationship between residential environment and subjective cognition towards elderly mental health is not well understood. This study conducted field interviews and questionnaire surveys in six typical high-rise residential communities in Wuhan. Structural equation models were used to analyse the overall effects and influence paths of elderly mental health, considering individual characteristics, high-rise residential environmental factors, and subjective cognition. The results showed that high-rise residential environment impacts mental health, mediated by subjective cognition. Multiple factors influence the subjective cognition of the elderly, and the accessibility to green spaces has been found to have a significant positive impact on their mental health. This impact includes both direct and indirect effects. The overall influence of green spaces on elderly mental health is the greatest, with a direct effect of 0.072 and an indirect effect of 0.242. This study provides information for decision-makers and individuals involved in developing inclusive high-rise residential neighbourhoods that support the social interaction and well-being of the ageing population.