Denis Zakaria scored the winner on his Chelsea debut as Graham Potter’s side finished top of Champions League Group E with a 2-1 victory over Dinamo Zagreb at Stamford Bridge.
A 1-0 defeat at Zagreb on September 6 triggered the sacking of former Blues manager Thomas Tuchel, but Potter saw his side return to winning ways after the weekend defeat to his former club Brighton.
There was a concerning moment for Chelsea in stoppage time when England international Ben Chilwell was forced off after going down clutching his left hamstring.
Only seven minutes had passed when Zagreb briefly gave their hopes of finishing third a boost when Petkovic headed the visitors into the lead from close range.
Ten minutes later Sterling levelled with his first Chelsea goal since September 14.
The 27-year-old picked up the ball on the edge of the box from a Pierre-Emerick Aubameyang flick-on, weaved space to shoot from and then drilled low into the back of the net.
The home side had a chance to go ahead in the 26th minute, as Kalidou Koulibaly tried to guide the ball goalwards with a header from a corner, but it was over the bar.
Sterling also had a chance to add to his and Chelsea’s tally just before the half-hour mark after being picked out by Kai Havertz but his first-time hit sailed over the goal.
However, Chelsea were soon rewarded for their opportunities when Zakaria sent a low drive past goalkeeper Dominik Livakovic. Defender Sadegh Moharrami was on the post and managed to get a boot to the ball, but was unable to prevent it crossing the line.
At the start of the second half, Zagreb came close to finding an equaliser, but Edouard Mendy was equal to Josip Sutalo’s header.
The game continued end-to-end with Aubameyang seeing a drive from distance rebound off the crossbar.
Chelsea had another chance to cap off their victory in stoppage time, but Livakovic was equal to an attempted tap-in from Gallagher less than five yards out.