Sterling’s 13th goal of the season gave City a record 12th successive Premier League victory which restores their eight-point lead at the top of the table.
Sterling had scored decisive late goals in City’s previous two wins, over Feyenoord and Huddersfield, but his third strike of the week was his most dramatic of the lot, and sparked wild celebrations from City boss Pep Guardiola and his bench.
City had taken the lead at the start of the second half when Saints defender Virgil van Dijk got the final touch on Kevin de Bruyne’s free-kick.
But it appeared Saints got their reward for a determined display when Oriol Romeu swept home Sofiane Boufal’s pull-back with 15 minutes remaining.
Sterling, who were enjoying the most prolific season of his career, had other ideas.
He already had a goal disallowed for a foul on Saints keeper Fraser Forster moments earlier, but was not to be denied cutting in from the left, exchanging passes with De Bruyne and bending the ball past Fraser Forster.
Guardiola’s side had already made the most successful start in Premier League history, with 37 points from their first 13 games.
This win saw them become the first side to reach 40 points from 14 games, and maintained the advantage of eight points over Manchester United that they had at the start of the week.