What? What do you mean by that? Say it again! Really! What do you have against me? What do you hope to gain by contradicting me like that? To gainsay me thus? Thou knave!
Hmmm… gainsay seems to have switched it onto a different track. Well, it will do that, and none may gainsay this observation: it’s a strongly literary, in fact archaic, word now. Funny, though – we may think of Latin and Greek as the source of flowery language, but this word – and it’s far from the only one such – is a purely Anglo-Saxon word that is considered high-flown while its Latinate counterpart, contradict, is now quite ordinary, the sort of word one may use with a small child. (Try this: next time you want to say to some three-year-old in your charge “Don’t contradict me,” say instead “Don’t gainsay me,” and see what that gets.)
So where is the gain in this word? Apart from before the say, I mean. Well, it’s not the gain of getting things; that’s a different word from a different source – it’s related to French gagner “win”. No, the gain in gainsay is related to German gegen “towards” and is the same gain as you see in against. Its Latin equivalent is contra. And since you know that dict is a Latin root relating to saying, you can see that contradict really is Latin for gainsay (although gainsay can also mean “deny”, “refuse”, or “oppose”).
But of course it can’t escape the flavour of increase and advantage that one gets from gain. There may be a feeling of the act of saying being like an act of snatching something from another person for oneself: when you gainsay, you gain the upper hand by saying.
The voiced velar onset /g/ may also seem to give it more richness than its unvoiced counterpart /k/ that starts contradict. In fact, while contradict is a hard, clicky word of “short” vowels that is said with a skip (that unstressed middle syllable), gainsay has two even syllables, each with the same “long” stressed vowel, and an overall smoother feel: a word fit for a proud character from Shakespeare or some Regency novel. Mind you, it also makes me think of Pig Latin (which you may know as Igpay Atinlay).