Roberto Mancini’s Inter have slipped down to 13th in Serie A after back-to-back defeats and had been hoping the cup would bring a change of fortune.
But, with only seconds remaining, a quickly taken throw-in caught Inter defender Andrea Ranocchia off guard and Higuain got away and kept his cool to lift the ball over Juan Pablo Carrizo and into the net.
The Argentine had missed two early chances for Napoli before Inter forward Mauro Icardi struck the post in a lively opening.
Carrizo also made good saves from Higuain and Marek Hamsik before Kalidou Koulibaly volleyed over the bar from close range.
The game looked to be heading for extra-time until Higuain’s goal earned Napoli a two-legged semi-final against Lazio.
The other semi-final sees Juventus face Fiorentina.