Milan were not involved last weekend after their clash with Genoa was postponed after the unfortunate bridge collapse in Genoa.
The visitors got off to the perfect start in the 15th minute as Giacomo Bonaventura opened the scoring with a superb volley that sailed past goalkeeper David Ospina.
Napoli went in search for an equaliser, but they were unable to carve out chances as the flow match was disrupted by a number of needless fouls.
That proved to be the trend for the rest of the opening stanza, as Genaro Gattuso's charges went into the halftime break with a one-goal lead.
Milan started the second half with a bang as they doubled their advantage in the 49th minute thanks to a clinical finish from Davide Calabria.
Napoli reduced the deficit four minutes later as Jose Callejon unselfishley teed up Piotr Zielinski, who neatly tucked the ball into the bottom corner.
The home side then restored parity in the 67th minute as Bakayoko's clearance landed at the feet of Piotr Zielinski, who managed fire home from the edge of the box.
The comeback was completed with 10 minutes remaining as substitute Dries Mertens collected a pass from Allan before slotting past Gianluigi Donnarumma.