Philippe Mexes scored a late own goal to set up a tense finish in Milan, but the hosts held on to take the share of the spoils.
M'Baye Niang looked to fire the Rossoneri in front just minutes after halftime, but his 25-yard drive was deflected wide for a corner. Stephan El Shaarway's cross was poorly cleared by Albero Gilardino as Mexes spectacularly attempted to fire into the back of the Bologna net, but the visitors managed to clear to safety.
The hosts continued to dominate and should've gone ahead on the hour mark. Ignazio Abate strode forward to collect a deflected Niang pass, before pulling back for Pazzini. The Milan front-man, under pressure, fired just wide when it was perhaps easier to score.
Milan kept the heat on Bologna, but goalkeeper Federico Agliardi was again on hand to deny the hosts. A Niang corner was played back to the unmarked El Shaarawy, who fired goalbound, only for his compatriot to deny him.
The pressure paid off for Massimiliano Allegri's side, which found itself in front with 25 minutes to go. Pazzini took the ball down well before turning on the penalty spot. His goalbound effort took a wicked deflection off Mikael Antonsson, leaving Agliardi to watch helplessly as the ball nestled in the back of the net.
The Italian added his and Milan's, second with a little more than 10 minutes to go after bringing down Kevin Prince-Boateng's cross. Pazzini the looped the ball over his marker before smashing a volley past Agliardi to extend the hosts' lead.
A late Mexes own goal ensured a nail-biting finish at the San Siro after the Frenchman inadvertently put the ball into his own net following Christian Pasquato's header across goal. El Shaarawy came close to netting a superb third for the hosts in injury time, but his curling effort drifted just wide of Agliardi's post, but the Rossoneri did not need the strike, as they held on for all three points to climb into sixth place, two points behind Fiorentina.