After a dull first half, Sanchez produced a moment of magic to open the scoring when the Chilean wrong-footed two defenders in the box before calmly slotting home.
Substitute Giroud then made the win safe by nodding in from close range minutes after coming onto the pitch.
Mid-table Southampton rarely threatened. Their best chance came in the first half when Manolo Gabbiadini forced a fine save out of Petr Cech from close range, and they stay 10th.
The win means Arsenal move above Manchester United into fifth, three points behind fourth-placed Manchester City.
Relive Arsenal’s win at Southampton
Sanchez saves Arsenal in ‘must-win’ game
An awful run of form from January until early April had seriously threatened to end Arsene Wenger’s record of securing a top four finish in every season he has had at Arsenal.
However, four wins in their six games prior to the trip to St Mary’s had given hope that the season would not peter out.
In what was a must-win game, Arsenal’s players initially failed to rise to the challenge.
Alexis Sanchez provided the spark Arsenal needed but Granit Xhaka also impressed. He successfully completed 94.4% of his passes
They were ponderous in possession and lacked bite in attack. Too often they played passes square just inside the Southampton half before gifting possession back to the hosts when they approached the final third.
But in Sanchez they possess a player capable of producing something from nothing and that is exactly what he did midway through the second half.
His goal, which came after he sold two Southampton players a dummy to give himself a clear shot on goal, visibly relaxed Arsenal and from then on they played with confidence and freedom, allowing them to open up the hosts for a second time when Giroud headed in Aaron Ramsey’s cross.
The only negative for Arsenal was the loss of Alex Oxlade-Chamberlain to injury in the second half, although Wenger suggested it was not serious.
Sanchez has now scored 20 goals this season, making him only the fifth Arsenal player to reach that mark, after Ian Wright, Thierry Henry, Emmanuel Adebayor and Robin van Persie.
It was also his 14th away from home – more than another Premier League player has managed this campaign.
Victory not only moves Arsenal, who face Chelsea in the FA Cup final later this month, to within one win of Manchester City, but also four points behind Liverpool, who have played a game more.
In a season that has seen protests against Wenger and some fans calling for the Frenchman to leave, the possibility they could finish with FA Cup success and a place in the top four is a very real one.
Southampton boss Claude Puel’s long-term future is reportedly uncertain, with the Frenchman yet to show signs of taking the club forward since replacing Ronald Koeman last summer.
Saints did reach the final of the League Cup but have been firmly ensconced in mid-table in the Premier League this season, a disappointment having finished sixth last year.
The Gunners brushed aside Southampton 5-0 in the FA Cup in January and the hosts never looked like gaining revenge in this fixture.
Once again, Southampton were weak in attack. They had two shots on target in this game and have now managed just 12 shots on target across their last six Premier League games.
We stuck together – what they said
Southampton manager Claude Puel speaking to Match of the Day: “It’s often the same against the big six. We cannot find a win. Every time we play good quality football with chances but without the clinical edge and it’s harsh on the players.
“For me, we deserved at minimum a draw and maybe a win. For them, in one situation, they scored. It’s difficult to accept.”
Arsenal boss Arsene Wenger said: “We were focused and I felt that when we suffered we stuck together.
“We have another clean sheet and I know we can go forward and score goals. The whole team was dynamic, focused and showed a convincing desire to win the game.”