Wikus van Heerden scored a try a minute from full time to hand the Lions a 22-26 victory over the Highlanders in Dunedin.
The Highlanders took an early lead through a penalty by Lima Sopoaga but the Lions hit with two penalties to Elton Jantjies.
Shaun Treeby scored a break away try for the Highlanders which put the home side into the lead which they kept until the 54th minute when the Lions took the lead.
The final quarter saw the lead change sides several times as Sopoaga and Jantjies exchanged penalties before Van Heerden scored the match winner.
Former Springboks flanker van Heerden, swathed in bandages and streaming blood from a head wound, drove through the Highlanders' defence in the 79th minute to give the Johannesburg-based Lions their third win of the season and severely damage the Highlanders' playoff hopes.
Highlanders flyhalf Lima Sopoaga had kicked his team to the brink of victory, landing a conversion and five penalties for 17 points, but he missed touch from a late defensive penalty, allowing the Lions to mount the raid from which the winning try was scored.
Sopoaga had fought a kicking duel with his young flyhalf rival Elton Jantjies throughout the match and seemed to have gained the upper hand when his fifth penalty in the 67th minute gave the Highlanders a 22-19 lead.
Jantjies kept a spotless record, kicking two conversions and four penalties for 16 points.
The Highlanders started the match in sixth place on the championship table, looking for their ninth win from 13 games which would cement a place among the top-six teams which will contest the playoffs in four weeks.
Instead, they fell to a fifth defeat which may cause them to tumble out of the top six and could harm their playoff chances.
The Highlanders have matches remaining against the Western Force, Waratahs and the Blues.
The Lions played with enormous spirit to post the second win of their four-match tour of Australia and New Zealand, which concludes when they play the Hurricanes next weekend.
They trailed for large parts of the game, were behind 16-9 at halftime and by three points with a minute remaining but they showed patience and resilience to claim a last-gasp win.
The Highlanders should have clinched the match well before the final minute when van Heerden's try became decisive.
They had many opportunities but their play lost some of its usual coordination and authority.
New Zealand referee Jonathan White fired penalties randomly at breakdowns, mostly against the Lions, and his rulings led to frustration and occasional flare-ups between forward packs.
The Highlanders had worked hard, without absolute control, to carve out a 16-9 lead by halftime with a crucial try to center Shaun Treeby.
The Lions hit back with a second half try to backrower Joshua Strauss, leaving it level at 16-16 after 49 minutes.
Jantjies and Sopoaga exchanged penalties until the 79th minute when Sopoaga's missed touch gave the Lions the chance to rally and build toward the winning try.
Final Score Highlanders 22 Lions 26
Tries - S Treeby
Pen - L. Sopoaga 5
Con - L Sopoaga
Tries - J Strauss, W van Heerden
Pen - E Jantjies 4
Con - E Jantjies 2
Referee: Jonathon White (New Zealand)
Assistant referees: Garratt Williamson (New Zealand), Kane McBride (New Zealand)
Television match official: Keith Brown (New Zealand)
Highlanders : 1 .Jamie Mackintosh (C) , 2 . Mo Schwalger , 3. Chris King , 4 . Jarrad Hoeata , 5 . Josh Bekhuis , 6 .Adam Thomson , 7. Alando Soakai , 8. Nasi Manu , 9 .Jimmy Cowan (VC) , 10. Lima Sopoaga , 11.Siale Piutau , 12. Shaun Treeby , 13 . Kendrick Lynn , 14. Kade Poki , 15 , Ben Smith
Replacements: 16. Jason Rutledge , 17. Bronson Murray , 18. Nick Crosswell , 19. John Hardie , 20. Aaron Smith , 21. Matt Saunders , 22. Robbie Robinson
Lions : Jaco Taute, Dylan Des Fountain, Doppies la Grange (capt.), Butch James, Deon van Rensburg, Elton Jantjies, Jano Vermaak, Josh Strauss, Michael Rhodes, Derick Minnie, Franco van der Merwe, Wikus van Heerden, Patric Cilliers, Bandise Maku, JC Janse van Rensburg.
Replacements: Edgar Marutlulle, Jacobie Adriaanse, Warren Whiteley, Cobus Grobbelaar, Rory Kockott, Alwyn Hollenbach, Michael Killian.