Physiology and metabolism are often sexually dimorphic, but the underlying mechanisms remain incompletely understood. Here, we use the intestine of Drosophila melanogaster to investigate how gut-derived signals contribute to sex differences in whole-body physiology. We find that carbohydrate handling is male-biased in a specific portion of the intestine. In contrast to known sexual dimorphisms in invertebrates, the sex differences in intestinal carbohydrate metabolism are extrinsically controlled by the adjacent male gonad, which activates JAK-STAT signaling in enterocytes within this intestinal portion. Sex reversal experiments establish roles for this male-biased intestinal metabolic state in controlling food intake and sperm production through gut-derived citrate. Our work uncovers a male gonad-gut axis coupling diet and sperm production, revealing that metabolic communication across organs is physiologically important. The instructive role of citrate in inter-organ communication might be significant in more biological contexts than previously recognized.