Mata stepped up and scored a stunner of his own in the 86th minute, curling home a marvelous free-kick to tie the match late.
The Red Devils eventually found their winner via another set piece as a free-kick deflected off Alex Sandro and in.
After the match, Mata said he was proud of his team's fight following what turned out to be a vital win for Manchester United.
"Today was important, the 1-1, and after we scored again," Mata told BT Sport.
"Maybe in the future, there is a substitute where you go, take the free-kick and go back to the bench. You never know.
"I have confidence in my free-kicks at the moment. I train a lot.
"After training I get the ball and try. The goalkeepers help me out too."
The result lifts Manchester United into second place in Group H, two points behind Juventus, who have amassed nine points from four matches.
That makes Mata's goal and the subsequent winner vital for the English side, who now appear on a path towards the knockout rounds with a match against Young Boys looming.
"What a nice last five minutes," Mata said. "It is a very good night for us to get three points against Juventus in Italy. It is amazing!
"They have fantastic players and are a top team. We come back to Manchester with three points and that is football!
"The first half was not bad. It was quite even. They had chances but in the second half it was a fantastic goal from Cristiano Ronaldo.
"They had a few clear chances after that to win the game but they didn't and we came back. It is a very big step in the group."