Type 2 diabetes mellitus (T2DM) has become epidemic worldwide and is strongly associated with nonalcoholic fatty liver disease (NAFLD). The molecular mechanisms of microRNAs in NAFLD and T2DM development and the corresponding therapies remain unclear. We performed microRNA microarray validation to determine whether hepatic miR-34a-5p was significantly upregulated in db/db mice fed with a high-fat diet (HFD), a mouse model of T2DM with steatohepatitis. The potential role of miR-34a-5p and gallic acid (GA) in regulating hepatic lipid metabolism and diabetic steatosis was explored. GA improved the activities of antioxidant enzymes and suppressed lipid accumulation in the HFD-induced steatotic liver of db/db mice. In vitro, the silencing of miR-34a-5p in hepatocyte HepG2 cells ameliorated high glucose + oleic acid/palmitic acid mixture–induced accumulation of cellular triglycerides. We identified nuclear factor erythroid-derived 2-like 2 (NFE2L2) as a direct target of miR-34a-5p. Reduction in intracellular triglyceride and the expression levels of sterol regulatory element-binding protein 1 and fatty acid synthase by GA were mediated by the inhibition of miR-34a-5p expression in HepG2 cells. The findings suggest that GA improves hepatic lipogenesis by downregulating miR-34a-5p by suppressing NFE2L2 expression, indicating the potential therapeutic role of GA or an NFE2L2-activating agent in diabetic fatty liver disease.