Learning from competitors poses a challenge for existing theories of reward based learning, which assume that rewarded actions are more likely to be executed in the future. Such a learning mechanism would disadvantage a player in a competitive situation because, since the competitor’s loss is the player’s gain, reward might become associated with an action the player should themselves avoid. Using fMRI, we investigated the neural activity of humans competing with a computer in a foraging task. We observed neural activity that represented the variables required for learning from competitors: the actions of the competitor (in the player’s motor and premotor cortex) and the reward prediction error arising from the competitor’s feedback. In particular, the unexpected loss of the competitor (which was beneficial to the player) was positively correlated with activity in several brain regions including striatum and response inhibition system. Our results suggest that learning in such contexts may involve the competitor’s unexpected losses engaging the player’s response inhibition system, as they learn to avoid the actions that produced them.