While bifunctional synergistic flame retardants have demonstrated efficacy in enhancing the fire safety of epoxy resins (EPs), the grafting of specific functional monomers into flame retardant molecules, elucidating their mechanisms of action through comparative analysis, and concurrently achieving a delicate balance among flame retardancy, heat resistance, and mechanical toughness remains a significant challenge. Herein, this research present an innovative strategy to derive a novel sulfur-based bifunctional flame retardant, DSTA, based on the structure of the original flame retardant, DST, by grafting the ester chains to increase the bridge length of the molecular structure. As expected, the addition of flexible ester chains enabled DSTA to have a very high initial decomposition temperature and the heat-resistance index. DSTA can be used in low dosage compared to DST, enabling EP to achieve UL-94 V-0 rating. Combustion behavior showed that DSTA had the best ability to heat and smoke suppression for EP, and had faster response speed and higher fire growth index. Notably, pyrolysis volatiles tested on DSTA revealed that the ester chains can pyrolysis to release large amounts of CO2, which occurs in the early stages of pyrolysis and works together with other N-containing inert gases and P-containing radicals in the gas-phase to efficiently extinguish flames. Meanwhile, DSTA improves all mechanical properties of EP, which was attributed to the presence of ester chains. In summary, this work presents a new strategy for examining the impact of specific functional groups on the flame retardant mechanisms of EP.