To win the game / To come out on top / To get the upper hand
Literally 'to win the game'. Used figuratively when someone gains a decisive advantage or wins a competition or dispute.
In the end, patience won out over pride.
They came out on top in the last minute.
—Who won? —She got the upper hand.