Arbroath 1-2 Rangers
Rangers preserved their unbeaten Scottish League One record but were given a stern examination by Arbroath.
Jon Daly headed in from Fraser Aird's corner to give the division's winners a first-half lead.
Paul McManus took advantage of slackness in the Rangers defence to slot home Arbroath's leveller.
The hosts threatened to move ahead but it was Ally McCoist's side who claimed victory, Aird tucking away the winner late on.
The defeat leaves Arbroath seven points adrift at the bottom of the table with five matches to play.
However, Paul Sheerin's men started the brighter of the two sides and Kevin Nicoll fired over after being picked out by the player-manager early on.
Bobby Linn then dragged a low effort wide after racing clear of the visitors' back four and a Sheerin corner was then nodded over by Michael Travis.
Both sides had had penalty appeals turned down by the time Rangers took the lead, referee Euan Anderson disinterested by claims of handball against Arbroath's Alan Cook or Sebastien Faure's challenge on McManus.
Daly powered home a firm header from Aird's delivery to break the deadlock.
Undeterred, Arbroath continued to press and Linn's shot into the side-netting reminded Rangers they had a game on their hands.
Aird then drilled the ball off Sandy Wood's crossbar from 30 yards and also had a free-kick saved by the goalkeeper.
The Arbroath goal frame was struck again early in the second half as defender Travis narrowly avoided scoring an own goal with a wayward header.
Sheerin's men were then gifted an equaliser as Faure's header back to keeper Cammy Bell was intercepted and struck home by McManus.
Cook headed over another Sheerin delivery as Arbroath pushed for a crucial three points in their battle against relegation.
But they were undone when Daly's mis-hit shot was turned into the net by Aird.
There was still one more chance for the home side but Alex Keddie could not convert after Nicoll had headed on Sheerin's free-kick.