Inflammation plays a crucial role in sepsis-induced cardiac injury. The purpose of this study was to determine whether interleukin-5 (IL-5) affected lipopolysaccharide (LPS)-induced cardiac injury by regulating the inflammatory response. First, the expression level and source of cardiac IL-5 were examined, and the results showed that LPS treatment and cecal ligation decreased cardiac IL-5 expression in macrophages. In addition, LPS was used to establish a mouse sepsis model, and the effects of IL-5 deletion on cardiac injury, M1 macrophage differentiation and myocardial cell apoptosis were analyzed. The results showed that IL-5 deficiency significantly increased cardiac injury marker expression, worsened cardiac dysfunction, promoted M1 macrophage differentiation and exacerbated myocardial cell apoptosis in LPS-induced septic mice. The nuclear factor-kappa B (NF-κB) p65 pathway was inhibited by JSH-23, and the results showed that treatment with JSH-23 inhibited M1 macrophage differentiation and alleviated cardiac injury in LPS-treated IL-5-knockout mice. Furthermore, the effects of IL-5 deficiency on M1 macrophage differentiation and myocardial cell apoptosis were measured in vitro. The IL-5-mediated promotion of M1 macrophage differentiation was also reversed by S31-201, and the pro-apoptotic effect of IL-5 knockout on macrophage-mediated myocardial cell apoptosis was also reversed by JSH-23. In conclusion, we found that IL-5 knockout may exacerbate sepsis-induced cardiac injury by promoting M1 macrophage differentiation in mice. IL-5 may be a potential target for the clinical prevention of sepsis-related cardiac injury.