The past tense of gain the upper hand over is gained the upper hand over.
The third-person singular simple present indicative form of gain the upper hand over is gains the upper hand over.
The present participle of gain the upper hand over is gaining the upper hand over.
The past participle of gain the upper hand over is gained the upper hand over.