Does the verb to outwit necessarily have a negative connotation, i.e., trying to make a fool of somebody, or playing a trick?
No, not necessarily. It just means to come up with a better strategy so that you win. If you lose in a game of Scrabble, you can say "You've outwitted me". I suppose losing carries a negative connotation, but it depends what the stakes are.