Cristiano Ronaldo's sensational goal had given Juventus the lead in Turin, but the Italian side were stunned late by Juan Mata's 86th-minute free-kick and an own goal from Alex Sandro in the 90th minute.
With the 2-1 result, United won a Champions League game with two goals in the final five minutes for the first time since the 1998-9 final.
2 - Manchester United have come back to win a UEFA Champions League game with two goals in the final five minutes of a match for the first time since the 1999 final vs Bayern Munich. Drama. pic.twitter.com/OgN8bXdGmK — OptaJoe (@OptaJoe) November 7, 2018
On that famous night in Barcelona, Teddy Sheringham and Ole Gunnar Solskjaer scored in injury time to turn a one-goal deficit into a treble-clinching 2-1 victory.
United did not nearly win such a large prize on Wednesday but the victory did put them in a good position to qualify out of Group H, with Jose Mourinho's side now in second place on seven points through four games.
Juventus, who remain in first place on nine points, had not conceded in 356 minutes of Champions League play this season prior to Mata's goal, then conceded their second just three minutes and 30 seconds later.
It was also Juve's first home defeat in the Champions League group stage since the 2009-10 season, when they fell to Bayern Munich in Turin.