Goals from Michail Antonio and winter signing Jesse Lingard early in each half helped inflict a fifth defeat in six league games for Tottenham, whose consolation came from Lucas Moura’s header from a Gareth Bale corner.
The Hammers are now in fourth place, two points above Chelsea in fifth and have now recorded seven wins in their last nine league games.
The win was also Moyes’ first over Mourinho in 16 attempts, leaving the former Everton and Manchester United manager setting his sights his up on European football next season.
"To win this one today was really important because of the games we have got coming up," Moyes said. "I said a few weeks ago if we could hang in there, we could look at it further down the line.
"We are really excited by it because this time last year we were worried sick because we were going to get relegated. So we are thrilled with it.
"But the thing for me is that we can play much better than we are, and that is what excites me because there is more to come. We are ahead of our station at this moment in time. We have done half the job, let's see if we can finish the second half.
"Where does it take us? I am really hoping we can get into one of the European competitions but if it doesn't and we finish outside it, I think it would be hard to say the players have not had a good year."