Beaten at home by Serie A's bottom side last time out, the Rossoneri bounced back to stay three points clear of eighth-placed Sampdoria in their bid for a UEFA Europa League qualifying spot.
First-half goals from Hakan Calhanoglu and Giacomo Bonaventura ultimately proved just enough for Milan, but the manner of victory will not have entirely satisfied Gennaro Gattuso, who accused his players of lacking soul following the "rock bottom" defeat to Benevento.
It looked as though they might suffer similar disappointment when Sebastien De Maio pulled one back for Bologna with 16 minutes remaining, the hosts having twice had goals chalked off the opening 45 minutes.
But, though it wasted opportunities to put the result beyond doubt, Gattuso's side did navigate its way to a welcome first win since mid-March that gives it some momentum ahead of the Coppa Italia final against Juventus.
Milan's recent malaise showed few signs of disappearing over a passive first half hour in which they failed to register a shot.
The sluggish start looked to have cost them the opener when Rodrigo Palacio bundled in a rebound at close range in the 19th minute, but Riccardo Orsolini was ruled offside from the initial header.
That proved the wake-up call Milan needed as it went ahead through its first genuine attack.
It was a beauty from Calhanoglu that did it, the Turkey international lashing a sweet strike into the bottom left corner from Patrick Cutrone's knock-down on the edge of the area.
Bologna had the ball in the net for a second time five minutes later and thought they were level through Orsolini, only for the VAR to spot a contentious handball from Palacio in the lead-up.
The host's frustration grew in first-half stoppage time as Erick Pulgar's poor touch allowed Calhanoglu to work the ball to Bonaventura, who made no mistake with a convincing low finish from just inside the box.
Milan appeared energised by the strong finish to the half with Cutrone smashing a shot against the near post soon after the restart, before Suso blazed over with time and space in the box.
The chances for a third were beginning to pile up by the hour, an unmarked Cutrone this time the culprit for failing to beat Mirante with the goal at his mercy.
Davide Calabria then came to the Rossoneri's rescue with a goal-line clearance amid a desperate scramble, while the crossbar denied Bonaventura a second at the other end after he unleashed from outside the area.
Gattuso's men eventually paid for the profligacy when defender De Maio stayed forward following a corner and headed in Simone Verdi's right-sided cross.
Steeped in nerves after that goal, Milan almost threw away their advantage away moments, but Gianluigi Donnarumma produced a strong hand to deny Ibrahima Mbaye and ensure a top-six finish remains a strong possibility.