Luciano Spalletti's men had no problem joining fellow scudetto hopefuls in capitalising on Juve's rare slip
Roma had dropped to third after AC Milan stunned champions Juventus 1-0 on Saturday when teenaged midfielder Manuel Locatelli beat Gianluigi Buffon with a second-half scorcher.
But Luciano Spalletti's men had no problem joining fellow scudetto hopefuls in capitalising on Juve's rare slip, the Giallorossi wowing fans with a well-oiled attacking performance that kept them firmly in the title chase.
"You have to be prepared to seize the day, climb on board and secure the right result as we did tonight," said Spalletti.
"But if anyone had a great result, it was Milan. They have the tools, beginning with their coach (Vincenzo Montella) to be able to challenge in this championship and they showed it."
Juventus remain top but their second defeat of the campaign, after a 2-1 reverse to Inter Milan last month, has reduced their advantage to two points on Roma and AC Milan.
Fellow title hopefuls Napoli are back in the hunt after a cagey 2-1 win at basement side Crotone on Sunday moved the 2016 runners-up to fourth, at only four points adrift.
A lightning start at the Stadio Olimpico saw Stephan El Shaarawy, who hit a brace in a 3-3 Europa League draw against Austria Vienna in midweek, come close with a smashing right-foot volley from Dzeko's pass.
The hosts finally broke the deadlock on 31 minutes, Mohamed Salah bursting through to meet Dzeko's flick and nutmeg Josip Posavec at the near post.
Palermo came close to a quick equaliser when Alessandro Diamanti's free kick, following a foul by Juan Jesus on the edge of the area, came off the far top corner.
But a rampant Roma virtually put the match beyond reach only six minutes after the restart, Posavec getting down low to collect Leandro Paredes' pacy free kick from the left only to miss the ball completely.
Diamanti's 25-yard drive forced Roma 'keeper Wojciech Szczesny into action soon after, and the Pole was down quickly to smother Sinisa Andelkovic's close range header moments later.
Spalletti had replaced Jesus with Alessandro Florenzi at half-time, and on 68 minutes Dzeko pounced on the Italy midfielder's delivery to beat Posavec with an unstoppable daisycutter.
Palermo reduced arrears when Robin Quaison beat Szczesny with a deflected 25-yard drive 10 minutes from the end.
But a Roma counter two minutes later saw El Shaarawy claim his third goal in two games when he collected Salah's unselfish pass to beat Posavec on 82 minutes.
If Juventus fail in their attempt to secure a record sixth consecutive title later this season, Milan' first win over the Old Lady in 10 attempts will be regarded as a turning point.
Juve showed throughout a stirring encounter why they are still the team to beat in Italy's top flight.
But failure to find a way past Milan's teenaged goalkeeping sensation Gianluigi Donnarumma proved costly, and the cancellation of a perfectly valid goal from Miralem Pjanic, has given hope to their title rivals.
Juve coach Massimiliano Allegri said: "It's clear that our goal was valid. I shouldn't say it, but everyone will say it."
At the other end, Juve goalkeeper Gianluigi Buffon was finally beaten by a superb drive from 18-year-old Locatelli -- although even he didn't know how.
"I really don't know how I did it, but I scored against the greatest goalkeeper in the world," said Locatelli.
Milan's fortunes contrasted with those of city rivals Inter, whose shock 2-1 defeat at Atalanta was the first time they had conceded three consecutive league defeats since 2013.
Coach Frank De Boer has reportedly been summoned by Inter's Chinese owners Suning, but ahead of Wednesday's outing against Torino the Dutchman says it's business as usual.
"I don't know what's happening (behind the scenes), I am here and I'll be analysing this match to prepare better for the ones coming up, hopefully with a view towards beating Torino," said De Boer.