Goals from Giacomo Bonaventura and Davide Calabria saw the Rossoneri take charge of the contest at Stadio San Paolo.
But a Piotr Zielinski brace and Dries Mertens's 80th-minute winner saw the host come out on top, as the boss of the Partenopi earned the bragging rights in a contest against old club, now coached by Gennaro Gattuso, a stalwart player in the Milan team that won the UEFA Champions League twice under Ancelotti.
"Milan played a splendid game, but after going 2-0 down, we showed great desire not to let go, to keep believing in our chances and to fight back vehemently," Ancelotti said.
"I have a fond memory of all my former players, but with Gattuso there is something special. It's a wonderful evening, one full of emotions for me. We've all been fortunate to experience it and I didn't even have to pay for a ticket.
"Milan hadn't really given many signs of being dangerous in attack, but surprised us with two similar goals. It was very difficult in that situation, then we changed system and the crowd pushed us on to turn it around."
After seeing his team give up the lead to make a losing start to the new domestic campaign, Gattuso sought to deflect the blame away from his players.
"The biggest regret is that after the goal for 2-1, we simply disappeared from the game," he said.
"Everyone started interpreting the match in their own way and we got lost. We've got to figure out how to improve this aspect of the side and I was disappointed by the lack of reaction we showed.
"I take full responsibility, because if the team is afraid, then that is the fault of the coach. We just switched off after the first mistake and it happened many times last season."