Kevin Nolan's first-half goal against his former club proved enough to see off a lacklustre Newcastle and propel West Ham into the top six.
Nolan ghosted in at the far post to turn in Joey O'Brien's mis-hit shot.
Newcastle were denied an equaliser when the officials ruled that goalkeeper Jussi Jaaskelainen had prevented Demba Ba's header from crossing the line.
Allardyce praises 'outstanding' victory
Former Magpie Andy Carroll could have given West Ham breathing space but Tim Krul pulled off a fine one-handed save.
The home side's performance was so lacking in precision or passion that a 2-0 scoreline would hardly have flattered the upwardly mobile Hammers.
And the result will bring immense satisfaction to West Ham boss Sam Allardyce, who last week described his sacking by the Magpies after 24 games in 2008 as one of the lowest points in his career.
In their first season back in the Premier League, the Hammers were comfortable victors - despite losing three players to injury - and, in the tireless Nolan, had comfortably the best player on the pitch.
Indeed, Newcastle boss Alan Pardew's pre-match suggestion that he would welcome Nolan and Carroll back to St James' Park looked entirely justified in a blunt attacking display in which striker Papiss Cisse and his half-time replacement Shola Ameobi were particularly ineffective.
John MurrayBBC Match of the Day commentator
"It is West Ham's day, Sam Allardyce's day and Kevin Nolan's day. Big disappointment for Newcastle, but West Ham now have 18 points from 11 games back in the Premier League and that is a more than satisfactory return."
An opening 30 minutes low on quality and goalmouth action was characterised by misplaced passes and mistimed challenges.
Both sides were forced into an early change. First, Newcastle captain Jonas Gutierrez came off worst in a 50-50 tackle with Yossi Benayoun, then West Ham winger Matt Jarvis made way for Mali forward Modibo Maiga.
Carroll, whose every touch for Liverpool was booed when the sides met in April, received a noticeably less hostile reception from the fans who used to revere him.
In the context of a dire game, West Ham's opener was as unexpected as it was welcome for the neutral. A cross aimed at Carroll was headed as far as O'Brien on the right and the full-back's shot was turned in by Nolan.
The Hammers midfielder, who declined to perform his trademark chicken dance celebration against his old club, could have doubled the lead moments later but he sliced his left-footed shot wide from the edge of the box.
Newcastle's rally, which began before the break with half-chances for Hatem Ben Arfa and Yohan Cabaye, almost brought the equaliser within a minute of the restart.
Did you know?
Sam Allardyce has won his last five matches as a Premier League manager against Newcastle, including the three games since they fired him in January 2008.
Ba's powerful header bounced awkwardly in front of Jaaskelainen, who clawed the ball back from the goal-line. Newcastle's players were convinced the ball had crossed the line but inconclusive replays appeared to justify the officials' decision not to award a goal.
The Magpies continued to press forward but their play lacked subtlety in the final third.
Most of the home side's best chances came from corners, with half-time substitute Shola Ameobi wasting a free header from Cabaye's perfect delivery.
Newcastle's commitment to attack was always likely to leave gaps at the back and when Carroll capitalised on a defensive mix-up to exchange passes with Nolan, the former Geordie favourite found himself clean through on goal.
Carroll's slight hesitation, however, gave Krul time to set himself and pull off an excellent stop with his outstretched left hand.
Newcastle had no verve - Pardew
The hosts' desperation for an equaliser saw Krul sent up for a late corner, but the Hammers held on for their first win at St James' Park since October 1998.
Newcastle boss Alan Pardew:
"We are kicking ourselves. It was the West Ham performance we knew we were going to get but what we lacked was the verve and imagination to unlock them.
"We had eight or nine shots but none with any purpose or quality. Newcastle at home must score one, two, three or maybe 4 and we got none today.
"It's nothing to do with our European game - we made lots of changes and the team was fresh - but we didn't do ourselves justice in the first 30 minutes. We didn't come alive until they scored and that is not good enough.
"We've got a home game [against Swansea] next week and we're under pressure to produce a performance and win."
Read West Ham manager Sam Allardyce's reaction
Full Time The final whistle goes and the game is over.
Free kick awarded for a foul by Shane Ferguson on Guy Demel. Gary O'Neil takes the free kick.
Effort on goal by Yohan Cabaye from outside the area goes harmlessly over the bar.
Corner taken short by Hatem Ben Arfa.
Handball decision goes against Mike Williamson. Free kick taken by Mark Noble.
Shola Ameobi takes a shot. Save by Jussi Jaaskelainen.
Foul by Shola Ameobi on Andy Carroll, free kick awarded. Direct free kick taken by Jussi Jaaskelainen.
Corner taken right-footed by Mark Noble from the right by-line, Andy Carroll takes a shot. Kevin Nolan gets a block in.
Free kick awarded for a foul by Steven Taylor on Andy Carroll. Mark Noble restarts play with the free kick.
Substitution (Newcastle) makes a substitution, with Gabriel Obertan coming on for Danny Simpson.
Inswinging corner taken by Mark Noble from the left by-line, clearance by Mike Williamson.
Free kick taken by Jussi Jaaskelainen.
Booking Hatem Ben Arfa is shown a yellow card for unsporting behaviour.
Hatem Ben Arfa challenges Guy Demel unfairly and gives away a free kick.
Shola Ameobi is caught offside. Jussi Jaaskelainen restarts play with the free kick.
Andy Carroll takes a shot. Save by Tim Krul.
Hatem Ben Arfa takes a shot. Save by Jussi Jaaskelainen.
Inswinging corner taken right-footed by Yohan Cabaye, Headed effort on goal by Shola Ameobi from inside the penalty box misses to the right of the target.
Substitution Guy Demel is brought on as a substitute for George McCartney.
Effort on goal by Demba Ba from 25 yards. Save by Jussi Jaaskelainen. Corner taken by Hatem Ben Arfa, save made by Jussi Jaaskelainen. Hatem Ben Arfa decides to take the corner short.
Foul by Andy Carroll on Davide Santon, free kick awarded. Direct free kick taken by Tim Krul.
Free kick crossed by Yohan Cabaye, James Tomkins manages to make a clearance.
Booking Joey O'Brien receives a yellow card.
Joey O'Brien gives away a free kick for an unfair challenge on Davide Santon.
Gary O'Neil takes a shot. Save made by Tim Krul.
Inswinging corner taken from the left by-line by Yohan Cabaye.
Andy Carroll gives away a free kick for an unfair challenge on Mike Williamson. Danny Simpson restarts play with the free kick.
Mohamed Diame produces a drilled left-footed shot from deep inside the area which goes wide of the left-hand post.
Substitution Gary O'Neil is brought on as a substitute for Yossi Benayoun.
Demba Ba has an effort at goal from just outside the box which goes wide of the right-hand upright.
Shot by Yohan Cabaye. Save by Jussi Jaaskelainen.
Andy Carroll fouled by Davide Santon, the ref awards a free kick. The free kick is swung in right-footed by Mark Noble, save by Tim Krul.
Inswinging corner taken right-footed by Yohan Cabaye from the left by-line.
Demba Ba takes a shot. Save by Jussi Jaaskelainen. Corner taken right-footed by Yohan Cabaye from the left by-line, clearance made by James Tomkins.
Free kick awarded for an unfair challenge on Hatem Ben Arfa by George McCartney. Yohan Cabaye restarts play with the free kick.
The second half begins.
45:00 +4:11 Half time
Half Time The players leave the pitch at half time.
45:00 +4:08 Substitution
Substitution Papiss Cisse goes off and Shola Ameobi comes on.
Demba Ba fouled by Winston Reid, the ref awards a free kick. Yohan Cabaye takes the free kick.
Yohan Cabaye has a volleyed shot. Jussi Jaaskelainen makes a save.
Shot from 20 yards from Hatem Ben Arfa. Blocked by Winston Reid. Outswinging corner taken from the right by-line by Yohan Cabaye.
Yohan Cabaye takes the direct free kick.
Booking Mark Noble receives a yellow card for unsporting behaviour.
Free kick awarded for an unfair challenge on Hatem Ben Arfa by Mark Noble.
Mohamed Diame gives away a free kick for an unfair challenge on Mike Williamson. Steven Taylor restarts play with the free kick.
Shot by Shane Ferguson. George McCartney gets a block in. Yohan Cabaye takes the outswinging corner, Mike Williamson takes a shot. Save by Jussi Jaaskelainen.
Yohan Cabaye takes a short corner.
Effort from the edge of the penalty area by Kevin Nolan goes wide of the left-hand post.
Joey O'Brien takes a shot.
The assist for the goal came from Joey O'Brien.
36:45 Goal scored
Goal! - Kevin Nolan - Newcastle 0 - 1 West Ham Kevin Nolan fires in a goal from inside the six-yard box low into the middle of the goal. Newcastle 0-1 West Ham.
Kevin Nolan challenges Hatem Ben Arfa unfairly and gives away a free kick. Yohan Cabaye takes the direct free kick.
Substitution Modibo Maiga comes on in place of Matthew Jarvis.
Foul by Joey O'Brien on Davide Santon, free kick awarded. Direct free kick taken by Steven Taylor.
Free kick awarded for an unfair challenge on Shane Ferguson by Yossi Benayoun. Free kick crossed by Yohan Cabaye, comfortable save by Jussi Jaaskelainen.
Joey O'Brien gives away a free kick for an unfair challenge on Davide Santon. Free kick taken by Davide Santon.
Shane Ferguson crosses the ball, James Tomkins makes a clearance.
Papiss Cisse sends in a cross, Winston Reid manages to make a clearance.
Free kick awarded for an unfair challenge on Demba Ba by Mohamed Diame. Hatem Ben Arfa restarts play with the free kick.
Yohan Cabaye has a drilled shot. Comfortable save by Jussi Jaaskelainen.
Substitution Jonas Gutierrez goes off and Vurnon Anita comes on.
Short corner taken by Yohan Cabaye.
Centre by Danny Simpson, clearance by James Tomkins.
Free kick awarded for an unfair challenge on Mark Noble by Demba Ba. Mark Noble restarts play with the free kick. Yossi Benayoun has shot on goal from just outside the penalty box which goes wide of the right-hand upright.
Davide Santon fouled by Andy Carroll, the ref awards a free kick. Steven Taylor takes the free kick.
Shot from just outside the penalty area by Papiss Cisse misses to the left of the target.
The ball is swung over by Joey O'Brien, Steven Taylor makes a clearance.
Joey O'Brien sends in a cross.
Effort from 12 yards by Kevin Nolan. Inswinging corner taken by Mark Noble, Demba Ba manages to make a clearance. Winston Reid gets a block in.
Demba Ba is penalised for handball and concedes a free kick. Mark Noble takes the direct free kick.
Foul by Shane Ferguson on Joey O'Brien, free kick awarded. James Tomkins takes the direct free kick.
The ball is crossed by Shane Ferguson.
The ball is swung over by Shane Ferguson, clearance by James Tomkins.
Free kick awarded for an unfair challenge on Jussi Jaaskelainen by Papiss Cisse. Jussi Jaaskelainen restarts play with the free kick.
Matthew Jarvis produces a drilled left-footed shot from deep inside the penalty box which goes wide of the left-hand post.
The referee blows for offside. Yohan Cabaye restarts play with the free kick.
Free kick awarded for a foul by Andy Carroll on Jonas Gutierrez. Demba Ba restarts play with the free kick.
Danny Simpson delivers the ball, clearance by Joey O'Brien.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.