The Sardinian side trailed in the possession stats but enjoyed all the best chances, and Victor Ibarbo's 45th minute header looked like being enough to give them a first win against Milan since October 1998.
But when Davide Astori hauled Balotelli down in the box with nine minutes left, the former Manchester City striker picked himself up to score his third goal - and his second penalty - in two matches for Milan.
Cagliari will be kicking themselves for having blown a chance to end their run of defeats against Milan, while the visitors will believe they should have stolen a win with one of a string of late chances.
Balotelli started up front for Milan for the second time, but there would be no repeat of the early fireworks that marked his debut last week.
Indeed the opening period was a quiet affair, Milan dominating possession but doing precious little with the ball, despite the impressive efforts of M'Baye Niang on the wing to beat his man and put in crosses.
Despite Milan enjoying two thirds of the possession, Cagliari had all the best chances of the opening period, with Ibarbo forcing a good save from the charging Christian Abbiati after just 13 minutes and the same player shooting over while one-on-one with Abbiati eight minutes later.
So it was little surprise when Ibarbo made the breakthrough almost on the stroke of half-time, with Daniele Conti disconcerting the Milan defence by lobbing a pass over the wall rather than shooting with a free kick from 25 yards - and Ibarbo finishing with a brilliant backwards header to score just his first goal of the season.
The second half continued in a similar vein, with Conti's shot from just outside the box after 50 minutes the only real chance.
But 10 minutes from the end all that changed: substitute Bojan got a shot away in the box to force an excellent reaction save by Michael Agazzi with his right leg, a block which sent the ball shooting high into the air.
And as the players waited for it to fall to earth Davide Astori lost his head completely and wrestled Balotelli to the ground, robbing the striker of a clear chance.
The referee had no choice: he pointed to the spot, sent off Astori for a second bookable offence, and Balotelli calmly smashed the ball past Agazzi after pre-empting the keeper's dive.
With their tails up and substitute Kevin-Prince Boateng looking particularly dangerous, Milan pressed for a winner.
And needless to say it was Balotelli who had the chances: he forced a point-blank stop from Agazzi with a header, had a stunning bicycle kick volley disallowed for the ball having gone out of play just before Robinho's pass got to him, and almost headed in a rebound all in the final five minutes.
It was not to be, however, and the match ended in a draw with both teams no doubt feeling as though they could have won it.