The game ended 1-1 after 90 minutes before both sides scored in extra time to send the match to penalties.
The first eight spot kicks were scored before Mariano Andujar produced a fantastic left-handed save, diving to his right to deny Allan, allowing Gonzalo Higuain to despatch the final penalty.
Andrea Stramaccioni's side had earlier gone in front after 58 minutes when Cyril Thereau completed a flowing counter-attack with a smart finish, low to Andujar's left.
But the advantage lasted just seven minutes as Jorginho pulled Rafael Benitez's side level from the penalty spot after Duvan Zapata was felled in the box.
Things got worse for Udinese three minutes later when Silvan Widmer was sent off for a second bookable offence, but the visitors survived to the end of 90 minutes.
With the one-man advantage it was all Napoli in the first half of extra time until Marek Hamsik scored with an unstoppable effort from 18 yards in the 99th minute.
Udinese responded as substitute Panagiotis Kone connected with a half-volley from the edge of the box to force penalties, where Napol held their nerve.
Thank you for reading 5 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1