Acute myocardial infarction (AMI), a critical manifestation of coronary heart disease, presents a complex and not entirely understood etiology. This study investigates the potential role of immune infiltration and endothelial-mesenchymal transition (EndoMT) in AMI pathogenesis. We conducted an analysis of the GSE24519 and MSigDB datasets to identify differentially expressed genes associated with the TGF-β signaling pathway (DE-TSRGs) and carried out a functional enrichment analysis. Additionally, we evaluated immune infiltration in AMI and its possible link to myocardial fibrosis. Key genes were identified using machine learning and LASSO logistic regression. The expression of MEOX1 in the ventricular muscles and endothelial cells of Sprague–Dawley rats was assessed through RT-qPCR, immunohistochemical and immunofluorescence assays, and the effect of MEOX1 overexpression on EndoMT was investigated. Our study identified five DE-TSRGs, among which MEOX1, SMURF1, and SPTBN1 exhibited the most significant associations with AMI. Notably, we detected substantial immune infiltration in AMI specimens, with a marked increase in neutrophils and macrophages. MEOX1 demonstrated consistent expression patterns in rat ventricular muscle tissue and endothelial cells, and its overexpression induced EndoMT. Our findings suggest that the TGF-β signaling pathway may contribute to AMI progression by activating the immune response. MEOX1, linked to the TGF-β signaling pathway, appears to facilitate myocardial fibrosis via EndoMT following AMI. These novel insights into the mechanisms of AMI pathogenesis could offer promising therapeutic targets for intervention.