Chelsea looked destined to suffer a sixth defeat from nine league outings when Jan Bednarek put Saints 2-0 up after an hour, but Antonio Conte's decision to throw Giroud on from the bench proved a masterstroke, the visitors scoring three times in eight minutes.
Despite appearing to be in the ascendancy early on, Chelsea's lack of craft meant Southampton were comfortable, and that encouragement ultimately led to the home side breaking the deadlock.
Ryan Bertrand did well down the left before setting up Dusan Tadic for a straightforward fourth goal of the season.
Chelsea were not much better immediately after the restart and, after failing to heed a warning courtesy of Shane Long, the Saints' lead was doubled thanks to a fine finish from Bednarek, who was making his first start for the club.
It was only after Giroud's introduction in the 61st minute that Chelsea took charge, as the France international scored twice either side of an emphatic Eden Hazard finish to wrap up an unlikely victory and leave Southampton languishing in the bottom three.
Chelsea's early control was hindered by a lack of imagination in the final third, the visitors frequently hooking the ball into the box in the hope Alvaro Morata could make something out of it.
He did eventually threaten just before the half-hour mark, heading over from close range, but at that stage Chelsea had already been trailing for six minutes.
Former Chelsea defender Bertrand was the inspiration behind Southampton's breakthrough, charging up the left flank and outstripping Cesar Azpilicueta before teeing up Tadic for an easy finish.
Chelsea avoided further damage seven minutes before the break – James Ward-Prowse's long-range effort forcing Thibaut Courtois into action.
Marcos Alonso was then lucky to escape a red card on the stroke of half-time for catching Long on the calf with a studs-first challenge.
Southampton went agonisingly close to a second just after the restart – Long catching Chelsea on the break and seeing his effort tipped over by a desperate Courtois.
But the Belgium goalkeeper was helpless in the 60th minute. Ward-Prowse's deep free-kick was played towards the back post and Bednarek converted the delivery with a cushioned volley into the bottom-right corner.
Conte responded by introducing Giroud for Morata and the Frenchman quickly had an impact, heading Alonso's cross in from just inside the area.
Chelsea then equalised through Hazard with 15 minutes to go, as the Belgian smashed in from close range after Willian found him with a cut-back.
And Giroud completed the remarkable turnaround soon after, drilling into the bottom-right corner after Hazard's cross was not cleared, dealing a cruel blow to Saints' survival chances as they remain three points adrift of safety.
Key Opta stats:
- Southampton have lost consecutive Premier League games after scoring 2+ goals for the first time ever.
- Chelsea have won a Premier League game from two goals down for the first time since August 2002 under Claudio Ranieri (3-2 v Charlton).
- Mark Hughes is only the second manager to lose three Premier League games against the same opponent in a single season after Graeme Souness vs Arsenal in 2004-05.
- The Blues have won five in a row against Saints in the league for the first time ever.
- Dusan Tadic has been directly involved in 45 Premier League goals since his debut in August 2014 (18 goals, 27 assists), 14 more than any other Southampton player.
- Jan Bednarek is only the third Polish player to score in the Premier League, after Robert Warzycha in 1992 and Marcin Wasilewski in 2015
- Olivier Giroud has netted 19 goals in the Premier League as a sub, a haul only Jermain Defoe can better (24).
- Giroud is also the top-scoring sub in the Premier League this season, with six goals from the bench.
- Giroud is the first player to score an away goal against the same opponent for different clubs in a single Premier League season since Mikel Arteta (for Everton and Arsenal v Blackburn 2011/12)
- Eden Hazard has scored 69 Premier League goals for Chelsea; only Frank Lampard (147) and Didier Drogba (104) have netted more.