The key genes (CSPP1, ZNF84, HLA-DPA1, CCZ1, and LRRC8D) identified in this investigation exhibit robust potential as diagnostic biomarkers and promising therapeutic targets for MDD. Here, ZNF84 is linked to major depressive disorder.