Contributing to the welfare of others has been shown to have positive effects on people's social and psychological well-being (PWB). The current study examined whether social contribution (SC) could alleviate the negative effects of chronic pain on PWB through perceived social support (PSS) among midlife and older adults. The study consisted of 520 participants with chronic pain from the two waves of the Midlife in the United States dataset (MIDUS II and III). Results from the longitudinal moderated mediation analysis indicated that SC at Time 2 (T2) significantly buffered the negative effect of pain interference (PI) at Time 1 (T1) on PSS at T2, which indirectly alleviated the negative effect of PI at T1 on PWB at T2. The study suggested the protective role of SC and prosocial behaviors in mitigating the detrimental effects of chronic pain on social support and PWB.