The only free and comprehensive online etymological dictionary of the Spanish language
ganar (Verb) "to win," "to gain"
10th cent. Old Spanish ganar, gañar. A borrowing from an unattested word in Gothic, subject to several reconstructions: Čevelová & Blažek (20019) and de Alquen (2018) believe ganar is from *gainon "yawn," "open of the mouth;" RAE and Corominas (1991) reconstruct *ganan "to covet;" and Roberts (2014) posits Gothic *ganô "eagerness." See other comments in Meyer-Lübke (1890); Kluge (1891); Gamillscheg (1934).