The Magpies were in need of an uplift after their midweek League Cup debacle, where they faced surprising defeat against Championship club Nottingham Forest.
The star of the show was winger Ritchie who produced an outstanding performance on the day, and his work rate was inspirational to his team.
The first half was more of a start stop, with new signing Joselu having two poor touches inside the first 10 minutes.
The game’s first chance came from Newcatle’s right-back Javier Manquillo, whose poor cross nearly caught goalkeeper Joe Hart by surprise just after the 20 minute mark.
It was the Scotland international Ritchie, who started the move which led to the first goal for the hosts. He pressed the 18-year-old Declan Rice after he gave the ball away which created an opportunity for new signing Christian Atsu to pass the ball to Joselu, who opened the scoring for the Toon Army just after the half-hour.
Just as the match started to open up, on-loan midfielder Mikel Merino took his chance, but his shot was stopped by West Ham goalkeeper Joe Hart.
Newcastle's dominant performance in second-half
In the second half, West Ham started freely as they tried to equalise, and came close to level the score with a shot from Javier Hernandez cleared by Ciaran Clark off the line.
From then on, Newcastle picked up the pace and should have had a second in the 63rd minute, when Hart made another crucial save off Ritchie’s shot, which was then cleared on the rebound by former Manchester City man Pablo Zabaleta.
However, nine minutes later, Newcastle did manage to get another past Hart, as Ritchie produced a sublime cross for unmarked Clark, who made no mistake and passed the ball on the right hand corner.
Ritchie once again came close to scoring his team’s third, but Zabaleta came to the rescue on the cross of Chancel Mbemba.
But in the 86th minute, Serbia striker Aleksandar Mitrović scores third for the hosts on the assist of Ayoze Perez to seal the deal for the newly promoted club.