Myocardial ischaemia-reperfusion injury (MIRI) caused by the treatment of acute myocardial infarction (AMI) is the primary cause of severe ventricular remodelling, heart failure (HF), and high mortality. In recent studies, research on the role of necroptosis in MIRI has focused on cardiomyocytes, but new biomarkers and immunocyte mechanisms of necroptosis are rarely studied. In the present study, weighted gene co-expression network analysis (WGCNA) algorithms were used to establish a weighted gene co-expression network, and Casp1, Hpse, Myd88, Ripk1, and Tpm3 were identified as biological markers of necroptosis using least absolute shrinkage, selection operator (LASSO) regression and support vector machine (SVM) feature selection algorithms. The role and discriminatory power of these five genes in MIRI had never been studied. Single-cell and cell-talk analyses showed that hub genes of necroptosis were focused on macrophages, which mediate the functions of monocytes, fibroblasts, haematopoietic stem cells, and cardiomyocytes, primarily through the TNF/TNFRSF1A interaction. The polarisation and functional activation of macrophages were affected by the MIF signalling network (MIF CD74/CXCR4 and MIF CD74/CD44) of other cells. The results of the immune infiltration assay showed that the five genes involved in necroptosis were significantly related to the infiltration and functional activity of M2 macrophages. TWS-119 is predicted to be a molecular drug that targets key MIRI genes. A mouse model was established to confirm the expression of five hub genes, and ventricular remodelling increased with time after ischaemia-reperfusion injury (IRI). Therefore, Casp1, Hpse, Myd88, Ripk1, and Tpm3 may be key genes regulating necroptosis and polarisation in macrophages, and causing ventricular remodelling.