Stroke, a leading cause of disability and mortality globally, often cooccurs with depression or poststroke depression (PSD). The intricate interplay between mitochondrial metabolism and immune-related inflammation in depression and stroke remains a pivotal yet unresolved area. This study harnessed bioinformatics to elucidate the distinct contributions of mitochondrial metabolism and the immune microenvironment, as well as their complex interactions, to the pathogenesis of depression and stroke. By analyzing gene expression profiles from depression and stroke datasets alongside mitochondrial gene data, differentially expressed genes (DEGs) were meticulously identified, with a particular focus on mitochondria-related DEGs (MitoDEGs). Comprehensive functional investigations of common DEGs were conducted through Gene Ontology (GO) and Kyoto Encyclopedia of Genes and Genomes (KEGG) analyses. A robust protein–protein interaction (PPI) network was constructed, pinpointing ten hub-MitoDEGs intricately linked to depression and stroke. Furthermore, leveraging single-cell RNA sequencing analysis has shed light on gene expression across a myriad of cell types. Notably, these findings demonstrated immune cell dysregulation, revealing significant alterations in neutrophil and CD8+ T-cell infiltration within both the depression and stroke contexts. Correlation analyses revealed profound associations of the hub-MitoDEGs with mitochondrial metabolism, immune-related genes, and immunocytes. Importantly, this study also delineated ten potential drugs that target key genes implicated in depression and stroke, identifying promising avenues for innovative therapeutic interventions in these debilitating disorders.