The sodium-glucose cotransporter 2 (SGLT2) inhibitor empagliflozin (EMPA) and dual SGLT1/2 inhibitor sotagliflozin (SOTA) are emerging as heart failure (HF) medications in addition to having glucose-lowering effects in diabetes mellitus (DM). However, the precise mechanism underlying this cardioprotective effect has not yet been elucidated. Here, we evaluated the effects of EMPA and SOTA in a zebrafish model of DM combined with HF with reduced ejection fraction (DM-HFrEF). To compare the effects of the two drugs, survival, locomotion, and myocardial contractile function were evaluated. The structural binding and modulating effects of the two medications on sodium-hydrogen exchanger 1 (NHE1) were evaluated in silico and in vitro. DM-HFrEF zebrafish showed impaired cardiac contractility and decreased locomotion and survival, all of which were improved by 0.2–5 μM EMPA or SOTA treatment. However, the 25 μM SOTA treatment group had worse survival rates and less locomotion preservation than the EMPA treatment group at the same concentration, and pericardial edema and an uninflated swim bladder were observed. SOTA, EMPA and cariporide (CARI) showed similar structural binding affinities to NHE1 in a molecular docking analysis and drug response affinity target stability assay. In addition, EMPA, SOTA, and CARI effectively reduced intracellular Na+and Ca2+changes through the inhibition of NHE1 activity. These findings suggest that both EMPA and SOTA exert cardioprotective effects in the DM-HFrEF zebrafish model by inhibiting NHE1 activity. In addition, despite the similar cardioprotective effects of the two drugs, SOTA may be less effective than EMPA at high concentrations.