Neuronal information processing requires a large amount of energy, indicating that sugars and other metabolites must be efficiently delivered. However, reliable neuronal function also depends on the maintenance of a constant microenvironment in the brain. Therefore, neurons are efficiently separated from circulation by the blood-brain barrier, and their long axons are insulated by glial processes. At the example of the Drosophila brain, we addressed how sugar is shuttled across the barrier to nurture neurons. We show that glial cells of the blood-brain barrier specifically take up sugars and that their metabolism relies on glycolysis, which, surprisingly, is dispensable in neurons. Glial cells secrete alanine and lactate to fuel neuronal mitochondria, and lack of glial glycolysis specifically in the adult brain causes neurodegeneration. Our work implies that a global metabolic compartmentalization and coupling of neurons and glial cells is a conserved, fundamental feature of bilaterian nervous systems independent of their size.