Milan looked set to become defending champions Juve's latest victims as the Rossoneri trailed to a wonderful individual Adrien Rabiot goal and Cristiano Ronaldo's swift second on Tuesday.
But a remarkable turnaround saw Milan score three times in the space of six minutes through Zlatan Ibrahimovic, Franck Kessie and Rafael Leao, with Ante Rebic then securing the points after an awful Alex Sandro error.
Milan are unbeaten since the season resumed, also beating Juve's title rivals Lazio last week, yet it still appears Pioli will not be at the helm next season.
Widespread reports claim former RB Leipzig boss Ralf Rangnick will be installed as both head coach and technical director.
Pioli will not be distracted, though, as he said after the game: “I can’t waste energy thinking about situations that are not up to me.
“I am so happy here, proud and eager to end this season on a high. I like being with my team and whatever will be, will be. I just want to finish the championship well.”
He added to DAZN: "I don't think about what's going to happen on August 3. I'm focused on what we're doing.
"I hope to hit the target I was called for. I don't think about August 3rd; I like to train, I'm fine here. I can't think about the future and situations that don't depend on me."
Pioli, who saw Milan score four goals against Juve for the first time since 1989, added of the win: "I congratulate my players on a great day and a great victory.
"The work done at Milanello was important. The team is doing well, playing well, and I'm happy even if we haven't done anything yet.
"In 20 days, we play for everything. We think of Napoli [next]. There is satisfaction but great concentration. Everything we are doing needs to be improved. The level is high - if you make a mistake then you pay for it.
"The work of the staff was important. We were good at taking advantage of the penalty incident. We did well on the pitch.
"The first half was balanced, we were surprised. The team mentality is making a difference and we must keep going."
Rangnick's mooted dual-role would also impinge on Milan great Paolo Maldini's position at the club.
However, Maldini – the existing technical director – took a similar tone to Pioli as he spoke ahead of the Juve game, insisting his future was not an immediate concern.
"I don't know [about the future]," Maldini told DAZN. "I want to get to the end of this season in August by concentrating on the matches and the goals we have set ourselves."