In pursuit of food, hungry animals mobilize significant energy resources and overcome exhaustion and fear. How need and motivation control the decision to continue or change behavior is not understood. Using a single fly treadmill, we show that hungry flies persistently track a food odor and increase their effort over repeated trials in the absence of reward suggesting that need dominates negative experience. We further show that odor tracking is regulated by two mushroom body output neurons (MBONs) connecting the MB to the lateral horn. These MBONs, together with dopaminergic neurons and Dop1R2 signaling, control behavioral persistence. Conversely, an octopaminergic neuron, VPM4, which directly innervates one of the MBONs, acts as a brake on odor tracking by connecting feeding and olfaction. Together, our data suggest a function for the MB in internal state-dependent expression of behavior that can be suppressed by external inputs conveying a competing behavioral drive.