Background Depression severity significantly influences neuropsychiatric symptoms (NPS), yet the underlying mediating and moderating mechanisms of this relationship remain insufficiently explored. Methods We employed cluster sampling to select 414 LLD patients from 42 nursing homes across nine cities in Fujian Province, China. Mediation and moderation analyses were conducted using the PROCESS macro model to determine the interactions between depression severity, sleep quality, resilience, and NPS. Results The findings indicate that NPS prevalence among LLD patients in nursing homes is substantial. Sleep quality partially mediated the relationship between depression severity and NPS. Additionally, resilience moderated both the direct and indirect effects within the mediation model, highlighting its significant role in mitigating the impact of depression severity on NPS. Conclusion The results underscore the importance of targeting sleep quality and resilience in clinical interventions for LLD patients in nursing homes. Enhancing sleep quality and resilience could potentially disrupt the link between depression severity and NPS, thereby improving patient outcomes.