Berwick missed out on the chance to leapfrog Stirling into fourth place by conceding two goals in the last few minutes of a dramatic match at Forthbank.
Darren Lavery’s 39th-minute opener for Berwick was swiftly followed by the bizarre dismissal of Paul Currie during the celebrations.
Late goals from David Weatherston and Sandy Cunningham in the 89th and 93rd minutes won it for Stirling.
Cunningham’s stoppage-time winner was very cruel on ten-man Berwick, who were the better team in the first half and defended very well after the break with ten men.
Defeat leaves Colin Cameron’s men five points behind Stirling with four games to go in the race for the play-offs.
With so much at stake it was perhaps no surprise that there were so few chances in the opening half hour.
Berwick, however, looked more threatening and went ahead in 39 minutes when Cameron fed Lavery, who had space in the box to fire, right-footed, past Stirling goalkeeper David Crawford from close range.
In the ensuing celebrations in front of supporters, Currie was red carded. It is not clear whether the dismissal was for an offensive gesture or for swearing.
Berwick were furious about the decision, and it went from bad to worse when player manager Colin Cameron then limped off with an injury.
The visitors defended stoutly in the second half and restricted Stirling to very few openings, but the introduction of Cunningham for the final quarter made a difference to the home side.
On the counter attack, Berwick nearly added a second but a timely tackle from Phil Johnston stopped Ross Drummond in his tracks.
But as Berwick began to tire, the home side turned up the pressure and were rewarded in the final minute when Cunningham latched on to Jordan White’s flick and crossed for David Weatherston, whose shot from six yards went in via the inside of the post.
Three minutes into injury time when Cunningham stole in at the back post to head home what could prove to be a hugely important goal.
Stirling Albion: Crawford, McGeachie, Hamilton (Day 46), McClune (Cunningham 68), Bishop, C Smith, Johnston, Comrie, White, Weatherston, Weir (Ferry 79). Subs not used: Ashe, Forsyth, D Smith, Reidford.
Scorers: Weatherston 89, Cunningham 90+3
Berwick Rangers: Bald, Jacobs, Drummond, Cameron (Miller 40), Fairbairn, Tulloch, Gray (Russell 77), L Currie, Dalziel, P Currie, Lavery. Subs not used: Hoskins, Downie, O’Brien, Andrews.
Scorer: Lavery 39
Referee: Nick Walsh