Newcastle manager Eddie Howe praised his side for not being distracted by the upcoming League Cup final at Wembley to pick up a much-needed Premier League win at West Ham.
Captain Bruno Guimaraes scored the only goal of the game to lift the Magpies up to sixth place in the table.
They now face Liverpool at Wembley on Sunday for the chacen to lift a dmoestic trophy for the first time in 70 years.
Howe said: “That was one of our best wins of the season, not in terms of performance but desire and heart.
“We showed all the big ingredients you need to be a successful team. You need to win when the game is tight and find a way to get over the line. We defended really well after the first three minutes which were a bit scary. We deserved the win.
“That’s why for me it was such a good win, it would be easy for the players to be distracted but they were present. We’ll focus fully on Liverpool now. We’ll take everything into consideration.
“I felt we were in need of a win to go into the final with a real boost and lift.”
Defeat for West Ham leaves them in 16th place, with boss Graham Potter unhappy with the game’s only goal.
He said: “I thought it was a committed performance from us.
“The game ebbed-and-flowed. We are disappointed with the goal, it looks like two hands in the back of our centre-back.
“We had some moments, not enough to win it, but we were committed enough to get enough from the game.
“We have tried to address the foundation and give us some stability. Like I said, the effort, application and desire to run back and suffer for each other was there.
“On the back of two wins, it isn’t built in a day. We have to move step-by-step. You have got to carry on moving.”