Wiktionary
gain the wind
vb. (context nautical English) To reach the windward side of another ship.