Arsenal's first two goals were both shrouded in controversy and the visitors were left pointing an accusing finger at referee Mike Dean.
He awarded the Gunners a 13th minute penalty that Thierry Henry converted after Steve Lomas was sent off for tugging back Robert Pires.
Jermain Defoe then brought West Ham level with a well taken strike after a poor backpass by Edu in the 39th minute, but Hammers' hopes of pulling off one of the shock results of the season were shattered 20 minutes from time, when the referee failed to spot Dennis Bergkamp slamming his left arm into the face of Lee Bowyer before crossing to the far post for Henry to head Arsenal 2-1 in front.
The brilliant Frenchman completed his hat-trick five minutes from the end with the Eastenders still fuming about the decisions that went horribly against them.
David James was outstanding but West Ham had 10 heroes at Highbury, where they deserved great sympathy for a fantastically spirited back-to-the-wall performance.
Hammers, with Michael Carrick (groin strain) missing from midfield, switched new signing Bowyer into the middle to partner Edouard Cisse, while Trevor Sinclair reverted to the left flank and Joe Cole was given a free role just behind lone striker Defoe.
Lomas was playing on the right of midfield, in front of Christian Dailly, and it was from that side that Arsenal should have taken an early lead, but Bergkamp failed to convert Henry's cross.
The Dutchman and Robert Pires caused problems with their movement and these two combined to win the penalty. Bergkamp's deft, first-time lay-off put Pires in behind the West Ham back four and, in his desparation to catch the Arsenal player, Lomas made slight contact and down went Pires.
A booking for the Irishman and a penalty would have been enough for most referees but Dean harshly chose to brandish the red card, much to the dismay and bewilderment of Lomas and his team-mates.
After Henry sent James the wrong way from the spot, Hammers' noisy contingent at the Clock End must have feared the worst. Henry should have punished sloppy defending by Gary Breen and Dailly but the superb James spared his defenders' blushes with two great saves.
But with Arsenal failing to step up the pace, being content to retain midfield possession with no end product, the visitors quickly regained their composure.
There seemed little threat to Gunners' goal when Edu played a casual backpass that the ever alert Defoe read much quicker than Sol Campbell, racing onto the ball and sliding it under David Seaman from 12 yards with his right foot.
James also had to be at his sharpest again to deny Sylvain Wiltord at the end of an unchallenged run that ended with a close range shot from six yards and Arsenal knew that, in this form, the West Ham keeper would take some beating in open play.
Possibly the finest of his many excellent stops came in the 55th minute. Bergkamp was ruled offside but James wasn't aware of the flag as he clawed away another close-range effort.
Despite their numerical advantage, Arsenal never really found top gear. Their passing and build up play was too slow and deliberate to cause Hammers many problems and with great organisation and a determination to block every attempted shot, West Ham seemed to weather the inevitable second half storm.
With Ian Pearce typifying the spirit by bravely ignoring a knee injury sustained in an early second half collision with James (young Glen Johnson was poised to make his debut as his replacement), Arsenal couldn't find a way through the white shirted shield in front of James.
Until, that is, Bergkamp's clear foul on Bowyer was unbelievably missed by the perfectly-positioned referee and Henry headed a rare goal to give Arsenal a lead they had barely deserved.
Hammers had no option but to commit more men forward in the latter stages and when Pires picked out Henry alone in acres of space on the left, the Arsenal striker completed his hat-trick to take his league tally to 17 goals this season.
The defeat by a two-goal margin meant Hammers dropped below West Bromwich Albion on goal difference but West Ham should take great heart from this performance when they visit Charlton on Wednesday night.
Glenn Roeder was his usual dignified self despite his obvious disappointment at the contentious manner of the defeat. He said of the penalty award: "Pires certainly didn't need any excuse to fall over - he was hardly touched - and the sending off was a double whammy.
"The second goal was another bad decision that went against us, Bergkamp clearly putting his hand in Lee Bowyer's face. Everyone in the stadium saw it except then man who matters most.
After his recent high profile errors, the West Ham keeper was back to his best. Roeder agreed: "David James was in fantastic form and kept us in the game.
"We've got to take heart from a very resilient performance. On a more fortuitous day, we would have got a point from the game."
2 - Cisse has the first shot of the game, a speculative left-foot effort from Cisse that flies well wide of the target.
7 - Lauren's slip on the left allows Defoe to nip in and feed Cole, who finds Lomas in space on the right hand side of the penalty area. However, the Irishman's attempted pass to Bowyer runs out of play.
10 - Arsenal are gradually beginning to find their feet, and go extremely close to opening the scoring, as Henry's cross from the left is just inches away from the outstretched boot of an unmarked Bergkamp at the far post.
10 - Breen booked for foul on Henry.
13 - Disaster for Hammers, as Bergkamp's pass splits the defence and releases Pires, who is tugged by Lomas in the penalty area as he pushes the ball on. An obvious spot-kick is awarded, but worse is to follow as Lomas is harshly shown a red card by referee Dean, who rigorously applies the letter of the law for an adjudged professional foul.
14 - GOAL. Henry makes no mistake from 12 yards out to give Arsenal the lead. Arsenal 1 West Ham United 0.
15 - Hammers almost gift Arsenal an immediate second, as Breen's weak back-pass is intercepted by Henry, who is only denied by a brave save from James.
18 - Cole finds a yard of space on the edge of Arsenal's penalty area, but his weak left-foot shot is easily gathered by Seaman.
28 - Wiltord is allowed time and space to measure a shot from 25 yards out that travels just wide of James' right-hand post.
29 - Dailly's poor header allows Henry a free run on goal, but James once again comes to the rescue with a superb one-handed stop.
33 - James pulls off another excellent save, pushing Bergkamp's clever effort around his near post for a corner.
39 - It's James stealing the show yet again, as Winterburn's attempted clearance cannons off Wiltord and appears to be looping into the net, only for the Hammers keeper to amazingly pluck the ball out of the air with his left-hand.
40 - GOAL! 10-man Hammers equalise completely out of the blue, as Cole's pressure on the right forces Edu into a blind back-pass that Defoe latches on to and fires between the legs of Seaman. Arsenal 1 West Ham United 1.
44 - Wiltord's mazy run takes him past three static defenders but as he skips into the six-yard box, James is there again to deny him with a fantastic reflex block.
Added time: 2 minutes.
48 - Arsenal go close again, as Henry beats the offside trap and skips down the right before pulling the ball back for Silva, whose shot is blocked by a trio of brave Hammers defenders and then cleared by Breen. Pearce is injured in the melee and needs a few minutes of treatment before carrying on.
51 - Bergkamp booked for a foul on Cisse.
60 - Henry curls an effort high and wide from the edge of the penalty area.
61 - After a spell of sustained possession without displaying any real attacking prowess, Arsenal are getting closer to finding a breakthrough, and Edu's blistering shot is well blocked by James, who follows up to beat Pires to the loose ball.
68 - Substitution for Arsenal, Parlour replaces Edu.
69 - In a rare break out of defence, Bowyer's excellent crossfield pass finds Cisse, whose clever back-heel sets up Sinclair, but the England midfielder screws his shot high and wide.
70 - GOAL. Arsenal find the breakthrough they had been threatening, in controversial fashion once again. Bergkamp appears to raise a forearm as he is challenged by Bowyer, who is consequently left floored. However, the Dutchman is allowed to continue and whips in a cross to the far post, where Henry is waiting unmarked to head the ball past James for his second goal of the match. The appeals of the West Ham players fall on deaf ears. Arsenal 2 West Ham United 1.
82 - Substitution for West Ham, Minto replaces Winterburn.
83 - Lauren booked for foul on Sinclair.
85 - Parlour booked for foul on Bowyer.
86 - Substitution for West Ham, Moncur replaces Cisse.
86 - GOAL. Arsenal round off matters, as Bergkamp releases Pires, who in turn feeds Henry, for the Frenchman to tuck the ball past James and claim his hat-trick. Arsenal 3 West Ham United 1.
87 - Double substitution for Arsenal, Jeffers replaces Bergkamp and Luzhny replaces Wiltord.
89 - Jeffers beats Breen to the ball and races through clean on goal, but James is alert again to keep out his effort with a fine one-handed save.
Full time: Arsenal 3 West Ham United 1.