The 18-year-old striker joined Milan in August 2012 and became the second youngest goalscorer in the club's history later that year.
Niang believes the team's recent last-16 loss against Barcelona in Europe has taught him valuable lessons as they allowed a 2-0 first leg lead to slip away to lose 4-2 on aggregate.
"We missed out on Champions League success this season against the greatest team in the world," Niang said.
"Despite this, I know that at the top level you need take chances when you get them.
"I am very happy in Milan, I feel I am learning every day with the great coaches they have here.
"It is a dream come true for me to be at this club and I want to win titles here."