turn the tables
US /tɜrn ðə ˈteɪbəlz/
UK /tɜrn ðə ˈteɪbəlz/

1.
to reverse a situation, especially so that someone who was in a weaker position is now in a stronger position
:
•
After being down by two goals, the team managed to turn the tables and win the match.
•
She was always the underdog, but she finally managed to turn the tables on her rival.