Sterile inflammation triggered by endogenous factors is thought to contribute to the pathogenesis of acute and chronic inflammatory diseases. Here, we demonstrate that apoptosis-deficient mutants spontaneously develop a necrosis-driven systemic immune response in Drosophila and provide an in vivo model for studying the organismal response to sterile inflammation. Metabolomic analysis of hemolymph from apoptosis-deficient mutants revealed increased sarcosine and reduced S-adenosyl-methionine (SAM) levels due to glycine N-methyltransferase (Gnmt) upregulation. We showed that Gnmt was elevated in response to Toll activation induced by the local necrosis of wing epidermal cells. Necrosis-driven inflammatory conditions induced dFoxO hyperactivation, leading to an energy-wasting phenotype. Gnmt was cell-autonomously upregulated by dFoxO in the fat body as a possible rheostat for controlling energy loss, which functioned during fasting as well as inflammatory conditions. We propose that the dFoxO-Gnmt axis is essential for the maintenance of organismal SAM metabolism and energy homeostasis.