Despite leading 2-0 from the first leg in San Siro, Milan were beaten 4-0 by Barca at Camp Nou, and Allegri reckons that the tie turned in favour of the hosts when Niang missed a glorious chance before Lionel Messi levelled the tie one minute later.
"Of course, qualification was always going to be a matter of centimetres. We hit the post with Niang, then conceded with Messi," Allegri told reporters.
"In order to play these games, you need legs and I made these choices. If Niang had scored, my choice would have been praised. Luck was with us in the first leg, this time it went against us with Niang hitting the upright."
The draw for the quarter-finals will be made on Friday.