James Chester sliced Guy Demel's cross into the top corner of his own net to give Sam Allardyce his first victory in four matches and ease the home side's relegation fears
The Scotland goalkeeper was shown a straight red card for upending Mohamed Diame in the first half of Wednesday's Premier League game, but referee Mike Dean initially saw nothing untoward before pointing to the penalty spot three minutes later after consulting with his assistant as McGregor was receiving treatment for an injury sustained in the collision.
McGregor was dismissed for the second time this year when he eventually got back to his feet and Mark Noble sent substitute keeper Steve Harper the wrong way with the resulting penalty.
|VIEW FROM UPTON PARK
|By Harry Sherlock
What a woeful game of football. Here were two teams who promised so much yet delivered so little. Despite the sending off of Allan McGregor, Hull were the better team but that is not saying much at all.
In a game conducted in a rather poisonous atmosphere as the home fans grew increasingly frustrated, the Hammers appeared to lack the desire and imagination to go and win the game, and instead appeared to be holding out for a draw.
They were booed off at the end of the match, with many fans heckling both Sam Allardyce and his players. It is hardly surprising and the Hammers boss will have to significantly improve this team if he is to win the fans over once again.
West Ham were back in front when James Chester turned the ball into his own net and the home side, who were booed off at half-time and after the final whistle despite winning, held on to move above their opponents and Aston Villa to sit 11th in the Premier League table.
Sam Allardyce urged his side to cope with the anxiety that has stemmed from a poor run of form and West Ham appeared to take that on board, as Stewart Downing tested McGregor with an early left-foot strike.
Roger Johnson replaced James Collins when the centre-back picked up an injury after only eight minutes and the major talking point came 11 minutes later, when West Ham took the lead and Hull were reduced to 10 men.
Referee Dean initially seemed unmoved when Diame collided with McGregor after the midfielder appeared to handle the ball earlier in the move, but pointed to the spot three minutes later on the advice of his assistant.
McGregor was injured in the process and, after a lengthy delay as he received medical attention, Dean showed him a red card to compound his misery. Noble then sent Harper the wrong way from the spot after the former Newcastle United goalkeeper had replaced Alex Bruce.
Adrian was caught out by Wayne Rooney's stunning long-range strike on Saturday, but the West Ham keeper was alert to palm away Maynor Figueroa's long-range strike in first-half stoppage time.
Hull boss Steve Bruce's words of wisdom at the break appeared to have the desired effect as his side were level two minutes into the second half, when Huddlestone's free-kick hit Jelavic and flashed past the wrong-footed Adrian.
Adrian was embarrassed by Rooney at Upton Park at the weekend and Chester was left red-faced at the same end when he diverted Guy Demel's cross into his own net 53 minutes in.
Harper got down well to palm away former team-mate Kevin Nolan's venomous drive eight minutes from time, before West Ham fans held their breath when Huddlestone's long-range strike was tipped over by Adrian.
The home supporters became increasingly frustrated as Hull piled on the pressure in the closing stages, but the visitors were unable to snatch a point that they arguably deserved.