With a 3-1 lead from the first leg of their Italian Cup semi-final, Juventus travelled to Naples on Wednesday expected to secure their third consecutive final appearance.
The holders appeared to be cruising as they led 2-1 on the hour but two quick Napoli goals, the first following a howler from Juve goalkeeper Neto, forced them to resort to time-wasting and gamesmanship in the last 20 minutes.
Higuain was largely anonymous on Sunday.
Gonzalo Higuain defiantly drew a line under his controversial move to Juventus with a brace against Napoli, picking out the president of his former club and mouthing: "It's your fault".
Allegri and co remain on course for a historic treble, as they remain in the Champions League and are six points clear at the top of Serie A.
Juventus opened the scoring after six minutes when the teams drew 1-1 in Serie A on Sunday and they nearly made a similarly fast start, only for Alex Sandro to see his shot blocked.More news: North Korea mock-up video shows missiles blowing up the United States
Jose Callejon then set up another for Lorenzo Insigne in the 67th minute with some neat footwork but Juventus managed to disrupt Napoli's rhythm with spoiling tactics.
Tomas Rincon should have made the tie safe for Juve on the half-hour mark but, when presented with a simple opening by a bad Vlad Chiriches backpass, he somehow blazed over the crossbar.
Higuain made a gesture to the box, indicating that the Napoli chief was to blame for his departure.
Napoli needed a goal early in the second half to boost their chances and they got one after 53 minutes.
However, Higuain restored Juve's lead five minutes later after he was left unmarked to smash Juan Cuadrado's cross into the back of the net from the center of the area. "We want to fill up our diary for May and to do that, now that we're through to the Coppa Italia final, we need to beat Barcelona".