The 33-year-old Dutchman was stupidly sent off after Rangers had gone behind but great goals from Fernando Ricksen and Chris Burke and a Ross McCormack penalty secured a gutsy win.
Mols was handed the captaincy for his final game as a Rangers player but he lost control his emotions to ensure that his five years at Ibrox ended on a sour note.
He was booked in 27 minutes for complaining too vigorously after Dunfermline took the lead with a quickly taken free kick which caught the Rangers defence unawares.
And three minutes later he was heading for the tunnel when he collected a second yellow card for a reckless challenge on Dunfermline’s goal scorer Gary Dempsey.
It was an act of sheer folly from a senior professional who should have known better and it was a sad way for Mols to bow out of the Scottish game,
The Dunfermline goal came about in 26 minutes when Alan Hutton was judged to have used his right arm to control the ball just outside the Rangers box after Craig Brewster had flicked the ball on.
Rangers were still trying to organise themselves when Dempsey showed great initiative by clipping the ball into the top left corner.
The Rangers players were furious and chased after referee Alan Freeland to complain but the goal was allowed to stand and it looked like being a quite miserable afternoon.
However, in a remarkable five minutes before half-time the game was turned on its head and Rangers were on their way to an excellent victory.
Fernando Ricksen, who had taken over the skipper’s armband, had not scored all season when he took possession some 30 yards out on 41 minutes.
Dunfermline failed to close him down and he simply eased forward and fired a terrific right foot shot into the top right corner of the net.
It was a superb goal but Rangers roared into the lead in first half injury time with an even better one produced by little Chris Burke.
Ross McCormack did the spadework, cutting infield from the left to find Burke lurking around the box. The Rangers winger eased past two Dunfermline defenders and then produced a gorgeous lob which completely fooled Derek Stillie and nestled in the net.
From a seemingly hopeless position the 10 men of Rangers suddenly found themselves leading at half-time and there was even better to come 18 minutes into the second half.
Hard-working 17-year-old McCormack, making his first start, made it a day to remember when he won a penalty after former Ranger Barry Nicholson clearly tripped him on the left side of the box near the goal line.
The little teenager grabbed the ball and promptly smashed the ball from the spot into the right corner. It was his last taste of the action as Peter Lovenkrands replaced him just seconds later.
However, this engrossing contest was far from over as Dunfermline scored again in 66 minutes from another highly unusual free kick situation.
Zurab Khizanishvili fouled Craig Brewster on the edge of the box and Dempsey shaped up to take it. He curled the ball towards the back post, everyone missed it and it somehow found its way into the right corner of the net.
It was game on again and Dunfermline searched for an equaliser but Rangers managed to hold out for one of the gutsiest wins of their difficult season.
Sadly for Lovenkrands he had to limp out of the game six minutes from time but that gave a top team chance for 17-year-old Bob Davidson.
DUNFERMLINE: 20-Stille; 2-Bullen, 8-Mason, 5-Skerla; 11-Derek Young (69, 32-Tod), 7-Nicholson, 28-Labonte, 12-Dempsey, 18-Byrne (69, 17-Kilgannon); 9-Crawford, 10-Brewster (85, 43-Clarke).
Subs not used: 30-Thomson, 44-Greenhill.
Bookings: Byrne (47), Skerla (90)
RANGERS: 22-McGregor; 21-Ross (84, 48-MacKenzie), 32-Hutton, 15-Khizanishvili, 16-Vanoli; 30-Burke, 2-Ricksen, 27-Hughes, 45-Adam; 10-Mols, 50-McCormack (64, 26-Lovenkrands, 81, 49-Davidson).
Subs not used:64- Robinson, 52-Fetai.
Sent off: Mols (30)