Ollie Watkins had cancelled out Ben Johnson's rasping left footed drive, but Villa failed to close down Declan Rice shortly after and his long range effort clattered in off the post, before Pablo Fornals and Jarrod Bowen finished off a spirited fightback from the hosts.
For a side lacking in confidence, it was perhaps the worst possible start for Villa as Johnson rampaged forward from right-back and drove a left-footed shot into the far corner from the edge of the box.
It was the perfect start for Moyes in his 999th game as a manager, although any ideas of an easy afternoon were quickly dispelled.
Good work from John McGinn on the right released Emi Buendia and his cut back from the byline was confidently tucked home by Watkins to level the game.
Yet the Villans could not hold on until half time as England international Rice collected the ball some 25 yards from goal and sent a controlled drive past Emiliano Martinez.
A bad afternoon soon threatened to become an awful one for Villa as they were reduced to ten men, although replays showed it could have been nine.
Ezri Konsa was shown a straight red card after a VAR review determined he had brought down Jarrod Bowen deliberately, even though replays suggested defensive partner Kourtney Hause should have joined him.
Hause caught Pablo Fornals with a stray right arm in the face, yet referee Chris Kavanagh deemed the offence to only be worthy of a yellow card.
Moyes was pacing on his touchline and nearly watched his side concede an equaliser as Lukasz Fabianski was forced to touch a header onto the crossbar
Rice, who has a career best of five goals already this season, almost found his sixth when he arrowed a searing free-kick towards the bottom corner and watched in despair as Martinez palmed the ball away.
The game was wrapped up with ten minutes of normal time remaining for the Hammers, Jarrod Bown sprinting clear after substitute Tyrone Mings had raced forward for a free kick.
Although Bowen saw his shot saved by Martinez, Fornals was on hand to poke the ball home and the scoreline was soon made emphatic.
Michail Antonio burst clear of the defence and found substitute Manuel Lanzini in space, who selflessly squared the ball to Bowen and he added extra gloss to the scoreline.
A difficult day for Villa, but the happy Hammers have now equalled their club record of eight consecutive away victories in all competitions and march into November sitting comfortably in the Champions League spots as the away fans chanted 'Are you Tottenham in disguise?' to the beleaguered hosts.