Humans are exceptionally flexible in cooperation, partly due to our ability to recognize the roles of cooperative partners. While some non-human animals understand the need for a partner in such interactions, it is unclear whether they grasp the consequences of their partner’s actions and adjust accordingly. Previous studies utilizing economic games with non-human animals yielded mixed results. We investigated dogs, known for their close cooperation with humans, in a stag hunt game. Dogs could cooperate for better rewards or defect for lower ones, while their human partners would either cooperate, never cooperate, or act randomly. We control for attraction to food, side bias, and local enhancement. Dogs were more likely to coordinate with their partners when it led to better rewards, suggesting that they understood their partner’s actions. By highlighting this cognitive skill in dogs, we advance our knowledge of the intricate mechanisms driving cooperative behavior in non-human animals.