Sounds legal to me.
It is allowed if this is it.
Yeah, looks like a mistake on your friend's part, or him trying to pull one over on you.
Interestingly enough, though. I entered the two positions into an endgame tablebase, the position you last showed with black to move and the same position with your pawn advanced one and the knight illegally on g3 with black to move, and as it turns out, the first position is a draw with best play, but the second is a black win in 36 with best play!
So, your opponent's mysterious Ne3-g3 was actually a blunder, though I think it would have been very hard to punish his mistake, lol.
Here I was playing against someone who can really mess up a chess rule, if I may say?
As far as I can remember a knight moves like a letter L that is 3 suquares then any squares to the left to the right to the right and left, or whereever!
Any way, when I claimed an illegal move for that knight move and stopped the clock all I got is that my opponent don't want to hear about it and just looked up the ceiling like an idiot and pretend he doesn't hear the explanation OTB because he really can't remember where his knight really originated from.
Here is the position as I can recall.
Hope nobody moves a knight like that e3 to g3, hummmnnn?