The win allowed Liverpool to move to within six points of Premier League leaders Chelsea.
Jurgen Klopp's side were rattled for a spell after Jonathan Walters headed Stoke into an early lead at Anfield, but Adam Lallana restored parity before Brazilian striker Firmino netted with a minute of the first half remaining.
A Giannelli Imbula own goal and a first Premier League goal of the campaign for Daniel Sturridge in the second half put the seal on a third straight victory for the Reds, who are still unbeaten at Anfield this season.
The win allowed Liverpool to move to within six points of Premier League leaders Chelsea as they moved back above Manchester City, who they host at Anfield on New Year's Eve. Without a win in four games, Stoke are 13th.
"A very difficult game. The result doesn't show it but it was difficult," said Klopp.
"A lot of things we could have done better but we forced two goals with our quality -- really good, really important both of them.
"We adjusted a little bit at half-time, scored a wonderful third goal and then Daniel closed the game."
Klopp stuck with the same team that had beaten Middlesbrough and Everton away in their last two outings as Simon Mignolet was again preferred to Loris Karius in goal.
The Belgian had kept clean sheets in each of these games but he was beaten here inside 12 minutes as Stoke stunned the home fans.
Erik Pieters was quicker onto a loose ball than either Sadio Mane or Nathaniel Clyne just outside the area and his cross from the left was met by Walters at the near post. Mignolet got a touch to his header but could not keep it out.
Stoke were the last visiting team to win at Anfield when they beat Liverpool 1-0 in the League Cup semi-final, second leg, back in January -- although they eventually lost on penalties that night.
Stoke had their hosts on the ropes for a while and Joe Allen, facing his former club, engineered himself space in the box before seeing his shot saved by Mignolet.
There were groans coming from the Kop but Firmino lifted the home fans in the crowd of over 53,000 when his shot was blocked on the line by Peter Crouch and the equaliser then arrived after 34 minutes.
Glen Johnson appeared to want to control the ball inside his own six-yard area and Lallana pounced to tuck a low shot from a tight angle between goalkeeper Lee Grant and the near post and in for his seventh goal of the season.
Boosted by that, Liverpool ended the first half on top and they went in front just prior to the interval, Firmino collecting a James Milner pass in the box, taking a touch to control and another to tee himself up before firing across Grant and in off both posts.
It was a sixth goal of the season for him and came three days after he had been arrested and charged for drink driving in the centre of Liverpool.
Mane almost made it 3-1 seconds later with a shot that slid just wide but Liverpool ran away with the game in the second half.
Their third goal arrived just before the hour mark, as Divock Origi latched onto a Jordan Henderson pass and delivered a low ball in from the left that Imbula turned into his own net under pressure from Mane.
Sturridge had been on the field a matter of seconds in place of Origi when he broke his duck for the season.
Pouncing on a careless blind back-pass by Ryan Shawcross, the England striker's first touch took him round Grant before he rolled the ball in to complete the victory.