Utah (2-3, 0-2 Pac-12) forced turnovers 1:16 apart to open the game, including a play by Nate Fakahafua to score from 8 yards out after stripping the ball from Barkley after a bad snap.
But the Trojans (4-1, 2-1) turned the tables in the fourth, scoring twice in a span of less than 3 minutes to turn a 3-point game into victory in their first trip to Salt Lake City in 95 years.
Barkley connected with Lee with 12:10 remaining, then cornerback Nickell Robey intercepted a pass by Jon Hays and returned it 38 yards for a touchdown.
Lee finished with 12 catches for 192 yards. The teams combined for 736 yards of offense and 222 yards in penalties.
Utah led 14-0 less than 3 minutes in, and was up 21-10 with 8:54 left in the half after Hays passed 18 yards to DeVonte Christopher, electrifying the fourth-largest crowd in stadium history (46,037).
But Barkley answered with scoring passes to Randall Telfer and Robert Woods as USC took a 24-21 lead into the break.
The Trojans scored 28 straight before Utah put together a late drive.
Before the season the game was being touted as a possible showdown for the Pac-12 South title. But then Stanford upset then-No. 2-ranked USC on Sept. 15 and Utah lost
The Trojans have been trying to work their way back to the top of a league with six Pac-12 teams ranked in the Associated Press Top 25.
On Thursday night, they had to fight their way out of a big hole early.
On USC's second play from scrimmage, Rimington Award candidate Khaled Holmes skidded the snap to Barkley. He managed to pick it up but was hit immediately by defensive end Fakahafua, who spun Barkley around then grabbed the ball out of his hands and sprinted eight yards into the end zone. It gave Utah a 7-0 lead just 47 seconds into the game.
Two plays later reigning Pac-12 defensive lineman of the year Star Lotulelei bulldozed Holmes as he snapped the ball and pounced on the fumble with 12:57 left in the first.
Hays completed an 11-yard TD pass to Kenneth Scott two plays later.
Like that Utah was up 14-0 less than 3 minutes into the game.
Barkley brought USC back, driving the Trojans 75 yards in eight plays, capped by Silas Redd's 3-yard run, to pull USC within 14-7 midway through the first quarter.
After Utah bumped its lead to 21-10, Barkley countered a minute later with a three-play,74-yard TD drive, passing 41 yards to All-American Robert Woods and capping it with a 23-yard strike to tight end Telfer that pulled USC within 21-17.
Barkley gave USC its first lead with 4:38 left in the half on a 6-yard TD pass to Woods on third-and-goal from the 6.
The score was set up when Robey forced tight end Dallin Rogers to fumble on the Utah 34-yard line 3 minutes earlier.
Redd had a key play on the drive when he picked up a blitz, giving Barkley time to complete a 17-yard pass to Lee.
Barkley completed 23 of 30 passes, while Redd had 77 yards rushing on 17 carries before D.J. Morgan took over.
Hays finished 19 of 32 for 160 yards with a pair of touchdowns, but the interception proved costly
Utah also hurt itself with penalties, with eight for 82 yards in the first half alone and 13 for 122 overall.
The Utes had a 44-yard touchdown called back because of an ineligible player downfield late in the first half. The play was a reverse pitch-back to Hays, whose bomb was hauled in by Scott between a pair of defenders.
A 29-yard pass to Dres Anderson was called back by holding, and a late hit by Fakahafua on Barkley moved USC into the red zone and set up the Trojans' second touchdown.
The Trojans got a scare when Woods had to be helped off the field late in the first quarter after being decked by safety Brian Blechen during a punt return. Woods needed a while to get up then took eight stumbling steps before falling chest-first onto the red "U" at midfield.
He was checked out by several trainers before returning a play later.
If he was dazed, he did his best to hide it, with a 41-yard catch-and-run to set up USC's second touchdown. He finished with six catches for 69 yards.