Rangers relinquished their grip on top spot after just three days as Scott McKenna's winner gave Aberdeen only their second Ibrox win in 27 years.
Sunday's win over Hearts saw Steven Gerrard's team take the title race initiative.
But they stumbled back to second place as McKenna's early strike handed Derek McInnes' team a 1-0 win despite the Dons playing for an hour with 10 men following Sam Cosgrove's dismissal.
Gerrard had also warned his team to cut out the red cards or risk their title bid following Scott Arfield's ridiculous sending-off at Tynecastle – but the message did not get through to simmering striker Alfredo Morelos whose inability to control his emotions also saw him walk midway through the second half.
Aberdeen now climb into the top six having chalked up their third meeting with Gerrard's side without defeat this season.
A scrappy start littered with fouls suited the visitors more than it did a Rangers side short on ideas and Aberdeen capitalised just seven minutes in.
Cosgrove was first to meet Niall McGinn's free-kick from the left wing. The ball looped up into the air but no-one in blue reacted, leaving McKenna to crash a left-foot volley home from 12 yards out.
Rangers responded impressively to going behind at Gorgie on Sunday but their attempts at a fightback this time were hampered by McInnes' dogged gameplan as the Reds sat deep before releasing a hungry press when their opponents looked set to build up a head of steam.
It took 24 minutes for Rangers to register a decent chance, with Morelos flicking a James Tavernier corner into the side netting. Lassana Coulibaly got on the end of another of the skipper's set-piece deliveries but headed over.
Cosgrove's dismissal on 33 minutes was a welcome boost. Having been cautioned for a lunge on Gareth McAuley early, the Englishman should have known better than to steam into Rangers' other centre-back Connor Goldson as a nothing ball bounced towards the corner flag.
His second yellow raised the temperatures and referee Steven McLean was forced to dish out a talking-to towards both benches after McInnes and Rangers assistant boss Gary McAllister went nose to nose.
Glenn Middleton almost made the most of the extra space just before the break, driving a low shot towards the bottom corner which Lewis did brilliantly to push it behind.
Gerrard decided action was needed at the break and threw on Kyle Lafferty for Jon Flanagan after another inadequate display from the full-back.
The extra firepower almost paid off immediately as Lafferty stung Lewis' fingers before the keeper was up quickly to parry Ryan Jack's follow-up to safety.
The keeper did not need to move as Morelos wasted a great opening on the hour mark, blasting over from six yards out.
The Colombia international lasted just three more minutes as his fiery temperament got the better of him and not for the first time this season. Booked just before half-time for a barge on Graeme Shinnie, he collected a second after catching the Dons captain with a flailing arm as the pair tussled in the centre circle.
Aberdeen felt McAuley should have followed the Colombian down the tunnel just after as he clumsily dragged down McGinn as his Northern Ireland team-mate looked set to burst though on Allan McGregor.
Rangers continued to toil in the final third but it fell to goalscorer McKenna to rescue the Pittodrie side at the death as his last-ditch tackle prevent Lafferty snatching a point.
ga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});
ga('pacontentapi.set', 'referrer', location.origin);
ga('pacontentapi.set', 'dimension1', 'By Andy Newport, Press Association Sport');
ga('pacontentapi.set', 'dimension2', '844d2ea2-2df9-49a8-8e62-68514d5ea319');
ga('pacontentapi.set', 'dimension3', 'paservice:sport,paservice:sport:club-news,paservice:sport:football,paservice:sport:match-reports');
ga('pacontentapi.set', 'dimension6', 'story');
ga('pacontentapi.set', 'dimension7', 'composite');
ga('pacontentapi.set', 'dimension8', null);
ga('pacontentapi.set', 'dimension9', 'sport:football');
ga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Scott McKenna\u2019s winner knocks Rangers off top spot'});