The hosts were poor in the opening stages, with Venezia, who were without numerous first-team players after a COVID-19 outbreak in the squad this week, racing into a shock lead through French forward Thomas Henry in the 19th minute.
Inter rallied and got themselves level through Nicolo Barella five minutes before the break, before creating several openings after the interval to complete the turnaround.
A winner looked set to elude the champions as the match entered the dying stages, only for veteran Dzeko to climb highest to snatch all three points for Inter in the 90th minute.
"The team believed until the end," Inzaghi told DAZN. "The biggest problem is the San Siro pitch, it is becoming unplayable for both us and Milan.
"It is true we could have played better on this field, but objectively you can't play the football we want to on that surface. Something needs to be done, it has never been like this and now we need to fix it."
It appeared unclear this week whether the rising COVID-19 cases in the Venezia squad would lead to Saturday's clash being postponed, but the newly-promoted side managed to put a team together for the trip to Milan.
Their efforts appeared justified as the visitors looked untroubled early on before Henry powered a header into the net to peg Inter back.
Other than a Lautaro Martinez overhead kick midway through the first half that just missed the target, Inter offered little threat until Barella was on hand to score his second league goal of the season, reacting quickest after Ivan Perisic's effort had been saved.
Dzeko should have put Inter in front early in the second half, but somehow scooped over from only a few metres out.
For all their possession, Inter continued to create little. It was substitute Denzel Dumfries who made the difference, picking out a perfect cross for Dzeko to head home, as the 35-year-old took his Serie A tally into double figures this season in timely fashion.