Black's penalty secured a shock victory for Inverness
Ian Black's injury-time penalty lifted Inverness off the bottom of the Scottish Premier League as Rangers suffered a surprise defeat at Ibrox.
Rangers striker Kenny Miller had a goal disallowed for offside during a scoreless opening 45 minutes.
Inverness continued to frustrate their hosts after the break with goalkeeper Ryan Esson making some important saves.
And Black was successful from 12 yards after David Weir had been sent off for a professional foul on David Proctor.
Rangers' defeat allowed Celtic to go three points clear at the top of the division while Inverness moved one point above Falkirk, who now prop up the SPL.
The home side threatened early on as Miller's cutback found Kris Boyd, who swivelled in the six-yard box and fired the ball against the body of Esson.
Seconds later, Sasa Papac's deflected cross was hooked away on the goal-line by Inverness captain Grant Munro.
Miller fired the ball into the net after latching on to Maurice Edu's pass but the striker had already been flagged offside.
And just before half-time, Papac slid in at the back post to meet Steven Davis' cross, but Esson saved again.
Inverness continued to frustrate their hosts at the beginning of the second half with John Fleck having a shot blocked by Russell Duncan.
Fleck then turned provider, but one cross was deflected wide for a corner and captain Barry Ferguson was unable to convert another teasing low centre.
Kenny Miller (left) tries to escape marker Pavels Mihadjuks
And when Rangers did find the target, Esson was on hand to save Boyd's tame header.
At the other end, substitute Dougie Imrie sent Adam Rooney through on goal but, under pressure from Madjid Bougherra, the Inverness striker shot over.
But the home side continued to make the running and Papac had a powerful free-kick effort deflected over by Lionel Djebi-Zadi after Ferguson had been fouled just outside the box.
Bougherra ventured forward to meet substitute Steven Naismith's through ball but Esson came out quickly to make a brave save.
And Caley's keeper's heroics were rewarded when Proctor intercepted a wayward header by Weir and was then felled by the Rangers defender.
Weir was promptly red-carded before Black coolly sent McGregor the wrong way from the penalty spot to clinch a vital victory.
Rangers manager Water Smith: "We're very disappointed. We didn't play well enough.
"I felt we started the game as poorly as we've started any game since I've come back to Rangers and I think that set the tone for the evening.
"I didn't think we played that well in the second but at least we showed an intensity that was missing in the first half of the game.
"Overall, we can't complain about the result. Our overall play wasn't of the standard that it has been in recent matches.
"Give Inverness a bit of credit, they defended very well and we huffed and puffed for the whole evening.
"Over the period of the game I can't say we've thrown away three points because we didn't create that many opportunities for the amount of possession of the ball we had."
Inverness manager Terry Butcher: "We wanted a good performance tonight, a solid performance and we certainly got it.
"We wanted to keep more possession in the second half but Rangers came at us really strongly, through four up front and made us fall back. We just couldn't get out.
"But we knew that with the legs we put on with Dougie Imrie and Eric Odhiambo that we had a bit of craft and a bit of pace that could cause Rangers a few problems.
"We got the break when it mattered right at the end and Ian Black stepped up really well to score the penalty.
"From a confidence point of view, it's a massive, massive result for us and a massive performance because we're becoming a hard team to beat.
"We didn't play particularly great tonight but we defended very well as a team and if you've got that spirit and determination, you'll go a long way.
Rangers: McGregor, Broadfoot, Bougherra, Weir, Papac, Davis, Edu (Lafferty 64), Ferguson, Fleck (Naismith 74), Miller (Niguez 82), Boyd. Subs Not Used: Alexander, Beasley, Dailly, Whittaker.
Bookmark with:
What are these?