Serie A: Milan 1 Bologna 0
Clarence Seedorf's charges had struggled to create clear-cut chances against a stubborn Bologna defence on Friday, but a moment of magic worthy of winning any game from Balotelli four minutes from time snatched all three points.
The Italy international collected the ball and found the top corner with a superb strike from fully 35 yards, leaving visiting keeper Gianluca Curci with no chance.
Milan dominated possession in the first half but just could not create any clear-cut chances, and they needed Christian Abbiati to prevent Rene Krhin's goalbound header to keep the scores level at the interval.
Bologna twice came close to breaking the deadlock with Jonathan Cristaldo's half-volley going narrowly wide before Abbiati's fine stop denied Lazaros Christodoulopoulos.
But it was Balotelli who delighted the home crowd after a below-par Milan performance, with his 10th league goal of season enough to lift them to ninth in the table, while 16th-placed Bologna remain four points above the drop zone.
The hosts looked to dictate the tempo in the early stages and fashioned the first chance in the fourth minute when captain Riccardo Montolivo's effort stung the palms of Curci.
Montolivo was involved again 10 minutes later with a sweetly struck half-volley from 25 yards that Curci could only parry into the path of Balotelli, who could only scuff the rebound into the ground.
Milan were struggling to turn possession into clear-cut chances, and were almost caught cold when Andrea Mantovani's teasing cross from the left was met by the head of Rene Krhin, with the former Inter midfielder forcing a fine diving stop from Abbiati.
Having survived that scare, Milan had an opportunity just after the half-hour mark when Curci spilled Balotelli's weak free-kick from the left touchline.
Cristian Zaccardo - who came in for Cristian Zapata, who got injured in the warm up - reacted quickest, but his effort was blocked with the defender adjudged offside anyway.
There was a delay to the second half as referee Mauro Bergonzi needed treatment on a cut lip sustained when the ball struck him in the face in the opening period.
When play resumed, Milan continued to see the majority of the ball without showing any cutting edge in the final third.
And their inability to force opportunities twice nearly cost them dear just after the hour mark.
First Cristaldo stretched to meet Gyorgy Garics' cross from deep on the half-volley and guided his shot just wide of the post, before Christodoulopoulos' shot on the turn from the edge of the box looked destined for the top corner before Abbiati flung himself to the left to keep the scores level.
But just when it looked like Milan would remain frustrated, Balotelli unleashed an unstoppable strike from the right to claim an unlikely win.