This study investigated the therapeutic effects of N1-Methylnicotinamide (MNAM), a metabolic derivative, on T2DM mice induced by a high-fat diet and streptozotocin (STZ), focusing on its impact on the gut microbiome and immune modulation. MNAM significantly reduced hyperglycemia and enhanced insulin secretion, effects that were dependent on the presence of gut microbiota. It also mitigated STZ-induced weight loss and improved islet cell morphology, reducing islet cell mortality and increasing insulin (INS) levels. Flow cytometry analysis showed a decrease in T helper 17 cells (Th17) and an increase in Treg cells after MNAM treatment, corresponding to the upregulation of Treg markers [interleukin (IL)-10, forkhead box P3 (FOXP3)] and downregulation of Th17 markers [IL17A, RAR-related orphan receptor gamma (RORγt)]. Additionally, MNAM raised anti-inflammatory IL-10 levels while reducing pro-inflammatory cytokines [IL-17α, tumor necrosis factor (TNF-α), IL-6]. Microbiome analysis revealed decreased diversity and increased Blautia abundance post-MNAM administration. Treatment with Blautia not only reversed diabetes indicators but also modulated the Th17/Treg balance and reduced inflammation, with its metabolite sodium acetate mimicking these effects through the G protein-coupled receptor 43 (GPR43) pathway. These findings suggest that MNAM’s mitigation of diabetes operates through modulation of the gut microbiota and immune regulation, highlighting Blautia and its metabolite as potential therapeutic agents and providing a theoretical foundation for novel treatment strategies in T2DM.