Juve, who have been Italian champions for exactly 3,000 days, need to win one of their final three games to win their ninth title in a row.
They led through Matthijs de Ligt’s powerful drive.
But Ilija Nestorovski headed in an equaliser before Seko Fofana’s brilliant winner in injury time.
As Juve pushed for a winner, Fofana ran from the halfway line, beat Alex Sandro for pace before cutting inside De Ligt and slotting the ball under Wojciech Szczesny.
“We paid for a lack of order after a good first half,” said Sarri, whose future is reportedly in doubt.
“At this stage of the season, it is difficult, we are all tired. We have lost aggression.
Cristiano Ronaldo has been overtaken by Lazio striker Ciro Immobile in the golden boot race. Immobile scored his 31st goal of the season in Lazio’s 2-1 win over Cagliari to take him one above Ronaldo’s total.
They have only won one of their past five Serie A games, but the three teams below them – Atalanta, Inter Milan and Lazio – have all dropped points recently.
Sarri is hoping to win the first league title of his career.
Juve looked laboured at Udinese – who are not yet safe from relegation – with most of their 21 shots either speculative or from long range.
They play Sampdoria on Sunday (20:45 BST) – although could be champions before then if their rivals lose their weekend matches.