The Bluebirds looked to have been denied at St Mary's as their supporters chanted the name of club-record signing Emiliano Sala throughout the first match since his body, discovered in plane wreckage in the English Channel, was identified.
Sol Bamba's scarcely deserved opener was cancelled out by Jack Stephens in the 91st minute, but Cardiff still had time to rally once more in pursuit of consecutive top-flight wins for the first time since 1962.
Substitute Kenneth Zohore prodded a tame effort past stranded goalkeeper Alex McCarthy, allowing Neil Warnock's men to celebrate an improbable triumph that sees them leapfrog Southampton and move up to 15th.
The Saints had the better of a low-key first half but, lacking a presence up front, struggled to create genuine opportunities, with Nathan Redmond dragging well wide when granted a rare sight of goal.
That was as close as the home side came to scoring before Cardiff, with their first effort of note, took the lead after 69 minutes when Bamba pounced on Callum Paterson's header from a corner and poked the ball into the net.
It looked as though Cardiff would protect their clean sheet when Lee Peltier made a superb block from Charlie Austin after Neil Etheridge kept out Yan Valery, but Jack Stephens was left free from a set-piece and tucked home a right-foot effort in stoppage time.
The Bluebirds' dogged defensive effort had seen five minutes added on, though, and they immediately put Southampton under pressure at the other end, resulting in Zohore's scrappy finish following a lay-off from fellow substitute Victor Camarasa.
What does it mean? Momentum behind Bluebirds
Southampton could have pulled well clear of danger on Saturday but instead find themselves back in the mire. Cardiff have made a habit of winning late this season and this felt like a potentially season-defining moment. They have completed a league double over the Saints now - their first of the campaign - at least ensuring it remains congested at the bottom of the table.
Bamba and Bruno Ecuele Manga both defended bravely throughout, making several challenges within range of the Cardiff goal to ensure Neil Etheridge was scarcely tested. Then the former struck at the other end to cap an excellent display from the defensive duo.
Ralph Hasenhuttl has been praised since arriving at Southampton for the way he has used Redmond in a central striking position. But against a Cardiff defence that was happy to soak up pressure, the former Norwich City man's role was problematic for the Saints. Redmond was too often crowded out and neither he nor Shane Long managed to get in behind the defence.
Key Opta Facts:
- Southampton lost for the first time in six Premier League games (W2 D3).
- Cardiff have won consecutive top-flight games for the first time since April 1962.
- Southampton have kept just one clean sheet in their last 16 Premier League games (0-0 versus Chelsea in January).
- Cardiff have netted three 90-plus minute winners in the Premier League this season, a joint-high figure along with Wolves.
- Cardiff's opener from Sol Bamba on 69 minutes came courtesy of their first shot on target of the game.
- Kenneth Zohore has registered two goal involvements in his last three Premier League appearances (one goal, one assist), after managing just one in his previous 15 league games.