At the Stadio Olimpico, Ibrahimovic broke the deadlock just before the half-hour mark.
He drove home a low free-kick after Rick Karsdorp's foul on Rafael Leao.
Ibrahimovic believed he had claimed a second, and a fourth for the campaign, but VAR adjudged him to be offside, after 50 minutes.
Milan eventually claimed a second as Ivory Coast midfielder Franck Kessie converted from the penalty spot just before the hour mark.
The 18-time Italian champions' hopes of claiming the three points appeared to be dealt a blow with 25 minutes to play as France defender Hernandez was shown a red card for a second bookable offence.
They were then given a scare late on as Roma's Nicolo Zaniolo had an 81st-minute header blocked on the line before former Milan midfielder Stephan El Shaarawy claimed an additional time consolation effort.
Earlier, Poland midfielder Piotr Zielinski scored as league leaders Napoli overcame lowly Salernitana.
Zielinski claimed his second goal of the season with half an hour left at the Arechi Stadium as both sides finished with 10 men.
Napoli were without in-form Nigeria striker Victor Osimhen due to injury, with captain Lorenzo Insigne on the bench.
They failed to create a clear first-half chance.
"Insigne has a muscular fatigue, he was at risk of getting hurt," Napoli coach Luciano Spalletti said.
"I decided to keep him out, avoiding any risk," Spalletti added before Thursday's Europa League trip to Legia Warsaw.
Earlier, Joaquin Correa's slick second-half double earned Inter Milan a 2-0 win over Udinese to consolidate the defending champions' hold on third place.
The Argentina international joined Inter on loan from Lazio in August and made an immediate impact, scoring twice on his debut against Verona.
He repeated the feat, after missing three games this season through injury, against Udinese, who reached the interval having survived a seven-shot onslaught from Inter midfielder Nicolo Barella, and a goalmouth scramble.
Correa finally got the breakthrough goal on the hour, running through after Ivan Perisic's dummy to sidestep Udinese centre back Bram Nuytinck and shoot inside the near post.
Correa doubled up on the 68th minute, blasting the ball into the roof of the net with Denzel Dumfries providing a neat assist from the right.
Inter held on but only after their keeper and captain Samir Handanovic tipped a shot from Gerard Deulofeu over the bar, with the Spanish forward then having a goal disallowed for offside eight minutes from time.
Udinese extended their winless run to eight matches.
Elsewhere on Sunday, Serbia attacker Dusan Vlahovic scored a hat-trick to take his goal tally for the season to 10 in 12 games as Fiorentina beat Spezia 3-0.