Premier League: West Ham 2 Hull City 1
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.
Hull would have been even more aggrieved given that Diame appeared to handle the ball before being clattered by the former Rangers goalkeeper, but they were level two minutes into the second half when Tom Huddlestone's free-kick went in off Nikica Jelavic.
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.