Background: Major depression disorder (MDD) and atopic dermatitis (AD) are distinct disorders involving immune inflammatory responses. This study aimed to investigate the comorbid relationship between AD and MDD and to identify possible common mechanisms. Methods: We obtained AD and MDD data from the Gene Expression Omnibus (GEO) database. Differential expression analysis and the Genecard database were employed to identify shared genes associated with inflammatory diseases. These shared genes were then subjected to gene ontology (GO) and Kyoto Encyclopedia of Genes and Genomes (KEGG) pathway enrichment analyses. Hub genes were selected based on the protein-protein interactions using CytoHubba, and key regulatory genes were identified through enrichment analysis. Subsequently, we conducted immune infiltration and correlation analyses of the shared genes in AD. Finally, we employed three machine learning models to predict the significance of shared genes. Results: A total of 17 shared genes were identified in the AD_Inflammatory_MDD dataset (S100A9, PTGER2, PI3, SNCA, DAB2, PDGFA, FSTL1, CALD1, XK, UTS2, DHRS9, PARD3, NFIB, TMEM158, LIPH, RAB27B, and SH3BRL2). These genes were associated with biological processes such as the regulation of mesenchymal cell proliferation, mesenchymal cell proliferation, and glial cell differentiation. The neuroactive ligand-receptor interaction, IL-17 signaling, and Rap1 signaling pathways were significantly enriched in KEGG analysis. SNCA, S100A9, SH3BGRL2, RAB27B, TMEM158, DAB2, FSTL1, CALD1, and XK were identified as hub genes contributing to comorbid AD and MDD development. The three machine learning models consistently identified SNCA and PARD3 as important biomarkers. Conclusion: SNCA, S100A9, SH3BGRL2, RAB27B, TMEM158, DAB2, FSTL1, CALD1, and XK were identified as significant genes contributing to the development of AD and MDD comorbidities. Immune infiltration analysis showed a notable increase in the infiltration of various subtypes of CD4+ T cells, suggesting a potential association between the development of skin inflammation and the immune response. Across different machine learning models, SNCA and PARD3 consistently emerged as important biomarkers.