The Hammers had gone into the game with just one win in seven games – a run that had seen them seemingly slip out of contention for the Champions League places.
It looked like the slump was going to continue when Emmanuel Dennis knocked the ball past Craig Dawson in the fourth minute before firing a superb strike into the top corner.
However, West Ham hit back with two goals in two first-half minutes and doubled that in the second half to move fifth – and within four points of fourth-place Arsenal.
Asked how important the win was to make sure his side kept up with the Champions League contenders, Moyes said: “We are not talking about the top four, you are.
“We are only talking about doing the best we can, challenging the top, trying to be in and around the top teams if we can.
“We enjoyed it when we were in the top four and now looking forward, wanting to get back in again.”
West Ham initially struggled to impose themselves in the game but improved as the first half wore on and then shocked the Hornets with two quickfire goals.
First, Jarrod Bowen picked out Tomas Soucek and the midfielder equalised in the 27th minute with a first-time finish before Said Benrahma put the visitors ahead with a deflected strike.
West Ham ensured there was no way back for the hosts when Mark Noble converted a second-half penalty, awarded after a VAR review for a poor challenge inside the box on Bowen, who had a goal ruled out moments earlier for a foul in the build-up.
The excellent Bowen was again involved as the visitors sealed the success in injury time, cutting the ball back for Nikola Vlasic to side-foot home his first goal for the club.
While the Hammers are looking up again, Watford – who were booed off at full-time – are 17th and two points outside the relegation zone following a third successive home defeat.
Hammers end poor run but Hornets’ struggles continue
This was a much-needed win for a West Ham side that appeared to be struggling to show the form that had them challenging at the top end.
Even at the start of this game their quick, crisp counter-attacking football was rarely evident but, as Watford failed to build on their bright opening, the Hammers became more confident and looked more like their old selves.
Having been in danger of slipping out of the top six over the festive period, this victory means they can now refocus their push to finish in the top four.
For Watford, however, this was a disappointing loss, particularly as they were considerably more rested than West Ham, with this their first game since 10 December because of Covid-19 issues while the Hammers had played four times since then.
The form of summer signing Dennis, who scored his eighth goal of the season on Tuesday, has been one of the few bright spots of their campaign and he will undoubtedly have a big say in determining what division his side are playing in next season.
However, Watford now face the prospect of having to try to pull themselves away from the bottom three during January without their talismanic forward, who will be away for much of the month with Nigeria at the Africa Cup of Nations.
“We started very well and then in one minute conceded two goals,” said boss Claudio Ranieri.
“We must help each other to find the right solution individually and also as a team because [it is] not possible to continue this way.”