The Drosophila melanogaster (fruit fly) misexpression suppressor of Ras 4 (MESR4) gene encodes a potential transcription factor and plays critical roles in various biological processes, including embryonic development, lipid metabolism, eye-antennal development, and germline stem cell differentiation. However, whether it is involved in modulating intestinal homeostasis remains elusive. In this study, we provide compelling evidence demonstrating that MESR4 is a bona fide regulator in preventing age-onset intestinal leakage and dysbiosis in adult flies. Mechanistically, MESR4 is predominantly located at the nucleus of intestinal cells and controls the expression of bag-of-marbles (bam), thereby restricting the excessive activation of immune deficiency signaling during aging. The silencing of Relish (Rel), which encodes a key transcription factor of the immune deficiency signaling pathway, reverses the beneficial effects of MESR4 in mediating intestinal barrier function and fly lifespan. Collectively, our studies uncover an undescribed function of Drosophila MESR4 in the maintenance of intestinal homeostasis and overall organismal fitness.