When I say /w/ > /g/, I actually mean /w/ > /gu/ > /gu/, /g/. A really good example is gay, which came into Old French from Frankish as jai, but was displaced by gai via Old Provençal, which was from Gothic gaheis (gaheis), both ultimately from the same PGm source.
I'm guessing this is related to the oddities in the second paragraph of gain#Etymology 3? If French gagner > older gaaignier > Gothic gaaiginōn (gaaiginōn), then any /w/ > /g/ mutation seems irrelevant. And what of Spanish ganar?