idiom
gain the upper hand
Meaning
to get control or advantage over someone
Example
Through smart negotiation, the ambassador **gained the upper hand**.