Background This study aimed to investigate natriuretic peptide B ( NPPB ) co-expression genes and the pathways involved in post-ischemic heart failure (HF) among patients both with and without type 2 diabetes mellitus (T2DM). Methods The microarray dataset of GSE26887 was examined to detect the genes that co-expressed with NPPB from 19 post-ischemic HF patients’ peripheral blood samples (7 with T2DM and 12 without T2DM). NPPB co-expression genes were then screened using the R packet. Further, using online analytical tools, we determined the Kyoto Encyclopedia of Genes and Genomes (KEGG) pathway enrichment analysis, Gene Ontology (GO) annotation, and protein-protein interaction (PPI) network of the co-expression genes. The modules and hub genes of the PPI network were then identified using the Cytoscape software. Results In patients with T2DM, a total of 41 biological processes (BP), 20 cellular components (CC), 13 molecular functions (MF), and 41 pathways were identified. Further, a total of 61 BPs, 16 CCs, 13 MFs, and 22 pathways in patients without T2DM were identified. In both groups of patients, 17 BPs, 10 CCs, 6 MFs, and 13 pathways were enriched. We also identified 173 intersectional co-expression genes (63 positive, 106 negative, and 4 differently co-expressed in patients with and without T2DM, respectively) in both types of patients, which enriched in 16 BPs, 8 CCs, 3 MFs, and 8 KEGG pathways. Moreover, the PPI network (contained 237 edges and 170 nodes) with the top module significantly enriched in 4 BPs (the tricarboxylic acid metabolic process, citrate metabolic process, tricarboxylic acid cycle, and aerobic respiration) and 3 pathways (the citrate cycle, malaria parasite metabolic pathway, and AGE-RAGE signaling pathway in diabetic complications) was constructed. Conclusions This study used genome-wide co-expression genes to identify the potential functions and mechanisms of the NPPB gene in post-ischemic HF with and without T2DM. Our findings may elucidate the functions and roles of NPPB in patients with post-ischemic HF and facilitate HF management.