Although it is well established that HIV-related stigma, depression, and lack of social support are negatively associated with health-related quality of life (HRQoL) among people living with HIV (PLH), no studies to date have examined how these psychosocial factors interact with each other and affect HRQoL among incarcerated PLH. We, therefore, incorporated a moderated mediation model (MMM) to explore whether depression mediates the effect of HIV-related stigma on HRQoL as a function of the underlying level of social support. Incarcerated HIV-infected men with opioid dependence (N = 301) were recruited from the HIV units in Kajang prison in Malaysia. Participants completed surveys assessing demographic characteristics, HIV-related stigma, depression, social support, and HRQoL. Results showed that the effect of HIV-related stigma on HRQoL was mediated via depression (a1:beta = 0.1463, p < 0.001; b1:beta = -0.8392, p < 0.001), as demonstrated by the two-tailed significance test (Sobel z = -3.8762, p < 0.001). Furthermore, the association between social support and HRQoL was positive (beta = 0.4352, p = 0.0433), whereas the interaction between HIV-related stigma and depression was negatively associated with HRQOL (beta = -0.0317, p = 0.0133). This indicated that the predicted influence of HIV-related stigma on HRQoL via depression had negative effect on HRQoL for individuals with low social support. The results suggest that social support can buffer the negative impact of depression on HRQoL and highlights the need for future interventions to target these psychosocial factors in order to improve HRQoL among incarcerated PLH.