Prior research has widely recognized neurocognitive impairment (NCI), depression, and alcohol use disorders (AUDs) as important negative predictors of health-related quality of life (HRQoL) among people living with HIV (PLWH). No studies to date, however, have explored how these neuropsychological factors operate together and affect HRQoL. Incarcerated male PLWH (N = 301) meeting criteria for opioid dependence were recruited from Malaysia's largest prison. Standardized scales for NCI, depression, alcohol use disorders (AUDs) and HRQoL were used to conduct a moderated mediation model to explore the extent to which depression mediated the relationship between NCI, HRQoL, and AUDs using an ordinary least squares regression-based path analytic framework. Results showed that increasing levels of NCI (B = -0.1773, p < 0.001) and depression (B = -0.6147, p < 0.001) were negatively associated with HRQoL. The effect of NCI on HRQoL was significantly (Sobel z = -3.5600, p < 0.001) mediated via depression (B = -0.1230, p < 0.001). Furthermore, the conditional indirect effect of NCI on HRQoL via depression for individuals with AUDs was significant (B = -0.9099, p = 0.0087), suggesting a moderated mediation effect. The findings disentangle the complex relationship using a moderated mediation model, demonstrating that increasing levels of NCI, which can be reduced with HIV treatment, negatively influenced HRQoL via depression for individuals with AUDs. This highlights the need for future interventions to target these complex interplay between neuropsychological factors in order to improve HRQoL among PLWH, particularly incarcerated PLWH with AUDs.