Dutch defender Matthijs de Ligt had put the defending champions ahead three minutes before the break in Udine.
But a diving Ilija Nestorovski header seven minutes after the break got Udinese level with Seko Fofana scoring the winner in injury time.
Juventus remain six points ahead of second-placed Atalanta with three games left to play, and have another chance to seal the title for the 36th time on the pitch at home against 14th-placed Sampdoria on Sunday.
Maurizio Sarri’s side need just three more points and the coronation could come on Saturday, depending on the results of their rivals Atalanta, Inter Milan and Lazio.
But Juventus’s performance against the minnows from the north-east was worrying ahead of their crunch Champions League last 16 game against Lyon on August 7.
The game started with a clumsy header from Danilo, which almost resulted in an own goal before bouncing off Wojciech Szczesny’s post.
Udinese keeper Juan Musso denied Paulo Dybala — who was wearing the captain’s armband — after 13 minutes with Ronaldo’s long-range effort wide before De Ligt broke through, smashing in after 42 minutes.
Back after the break, Nestorovski took advantage of an Alex Sandro error to equalise, getting his head to a cross from on-loan Watford midfielder Ken Sema to beat Szczesny.
And two minutes into extra time, Ivorian international Fofana capped a solid match by getting the better of De Ligt to all but ensure Udinese of staying in Serie A with his third goal this season.
It was a precious three points for Udinese who move up to 15th position, seven points clear of the relegation zone.
“Juventus wanted to win the championship, but we had a great game,” said Fofana.
“We said beforehand that (relegation rivals) Lecce were going strong and we had to push forward.”
Lazio, 11 points behind Juventus in fourth, play at Cagliari later on Thursday.
Download our app and read this and other great stories on the move. Available for Android and iOS.