Sergei Semak's Zenit saw Mauricio Pereyra level for Krasnodar in the first minute of added time, but Russian international Dzyuba sent the visitors eight points clear of reigning champions Lokomotiv Moscow with only six games remaining.
Krasnodar remain third, one point further back.
"It was a very difficult match," said Semak after seeing his side move a step closer to a first Russian title since 2015.
"We started well and could have decided the match in the first 15 minutes as we created a lot of chances."
Zenit started strongly, making Krasnodar goalkeeper Matvei Safonov the busiest player at a packed 34,000-capacity Krasnodar Stadium.
Dzyuba and Sardar Azmoun both had chances in the opening quarter-hour but Safonov denied them from close range.
He was beaten in the 19th minute, though, when Dzyuba scored his first league goal since October 7, tapping into an empty net from Emiliano Rigoni's cutback.
Ivan Ignatiev levelled six minutes later, stabbing home after Sweden striker Viktor Claesson's effort was blocked.
After the interval, Zenit pushed for a winner, and Ukrainian defender Yaroslav Rakitskiy hammered a magnificent 25-yard free-kick into the top corner midway through the second half.
Uruguayan midfielder Pereyra had the home crowd on their feet in the first minute of stoppage time as he drew them level again with a long-range screamer of his own, but Dzyuba had the final say with his 100th Premier League goal.
Elsewhere, Lokomotiv were held to a 1-1 draw by capital-city rivals CSKA.
German 2014 World Cup winner Benedikt Hoewedes put Lokomotiv ahead in the 13th minute, sweeping the ball into the net from a Fyodor Smolov cross.
But CSKA striker Fyodor Chalov equalised with five minutes remaining in the first half, netting his 12th goal of the season to maintain his lead in the league's top-scorers' chart.
CSKA finished the match with 10 men, as right-back Igor Diveyev suffered a head injury in the 88th minute when coach Viktor Goncharenko had made all three of his substitutions.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ