The starvation-inducible coactivator cAMP response element binding protein (CREB)-cAMP-regulated transcription coactivator (Crtc) has been shown to promote starvation resistance in Drosophila by up-regulating CREB target gene expression in neurons, although the underlying mechanism is unclear. We found that Crtc and its binding partner CREB enhance energy homeostasis by stimulating the expression of short neuropeptide F (sNPF), an ortholog of mammalian neuropeptide Y, which we show here is a direct target of CREB and Crtc. Neuronal sNPF was found to promote energy homeostasis via gut enterocyte sNPF receptors, which appear to maintain gut epithelial integrity. Loss of Crtc-sNPF signaling disrupted epithelial tight junctions, allowing resident gut flora to promote chronic increases in antimicrobial peptide (AMP) gene expression that compromised energy balance. Growth on germ-free food reduced AMP gene expression and rescued starvation sensitivity in Crtc mutant flies. Overexpression of Crtc or sNPF in neurons of wild-type flies dampens the gut immune response and enhances starvation resistance. Our results reveal a previously unidentified tolerance defense strategy involving a brain-gut pathway that maintains homeostasis through its effects on epithelial integrity.