Get the better of (someone)

To beat or defeat (someone), to win against someone.

My friend got the better of me and won the tennis match.