Both humans and animals seek primary rewards in the environment, even when such rewards do not correspond to current physiological needs. An example of this is a dissociation between food-seeking behaviour and metabolic needs, a notoriously difficult-to-treat symptom of eating disorders. Feeding relies on distinct cell groups in the hypothalamus, the activity of which also changes in anticipation of feeding onset. The hypothalamus receives strong descending inputs from the lateral septum, which is connected, in turn, with cortical networks, but cognitive regulation of feeding-related behaviours is not yet understood. Cortical cognitive processing involves gamma oscillations, which support memory, attention, cognitive flexibility and sensory responses. These functions contribute crucially to feeding behaviour by unknown neural mechanisms. Here we show that coordinated gamma (30-90 Hz) oscillations in the lateral hypothalamus and upstream brain regions organize food-seeking behaviour in mice. Gamma-rhythmic input to the lateral hypothalamus from somatostatin-positive lateral septum cells evokes food approach without affecting food intake. Inhibitory inputs from the lateral septum enable separate signalling by lateral hypothalamus neurons according to their feeding-related activity, making them fire at distinct phases of the gamma oscillation. Upstream, medial prefrontal cortical projections provide gamma-rhythmic inputs to the lateral septum; these inputs are causally associated with improved performance in a food-rewarded learning task. Overall, our work identifies a top-down pathway that uses gamma synchronization to guide the activity of subcortical networks and to regulate feeding behaviour by dynamic reorganization of functional cell groups in the hypothalamus.