SALT LAKE CITY — LeBron James came into the night averaging 30.2 points in 13 games against Utah — his highest personal average versus all opposing teams, and the second-highest individual career best against the Jazz.

First all-time? That would be a certain retired superstar named Michael Jordan, who merely averaged 32.7 points for Chicago and Washington in 26 regular-season games against the Jazz.

Move over, Mike, at least for one night.

But not to make way for Cleveland Cavaliers star James, who did score a game-high 36 points, including 18 of his club's 20 points at one point in the fourth quarter.

Unlikely Gaines hit the game-winner at the buzzer, allowing the Jazz to overcome second-half injuries sustained by both starting point guard Deron Williams and starting small forward Andrei Kirilenko, and beat the Cavaliers 97-96 in a late-starting, TNT-televised game at sold-out EnergySolutions Arena.

With Utah down by two, C.J. Miles in-bounded to a heavily guarded Kyle Korver, who passed to Ronnie Price, who found Gaines on the right side for a 3-pointer over Anthony Parker that fell through as the rookie dropped to the floor.

"I had a feeling the ball was gonna come to me," said Gaines, who is playing on a 10-day contract. "The crazy thing about it is I was sitting on the bench and I just dreamed about it happening. I said I knew Ronnie (Price) was gonna have the ball and I was gonna catch it and I was gonna hit the winner.

"Just for it to happen the same way I envisioned it — I mean, that's even more special for me."

The 22-17 Jazz won their third straight and snapped a four-game losing streak to the Eastern Conference-leading Cavs despite Williams re-spraining his right (shooting) wrist, an injury that caused him to miss a pair of games against Memphis last week, and Kirilenko hyperextending his right knee.

Sundiata Gaines, center, celebrates with his teammates after hitting the game-winning three-pointer over Anthony Parker of the Cavaliers at the EnergySolutions Arena. (Michael Brandy, Deseret News)

"I haven't been this excited in a long time," said Jazz coach Jerry Sloan, who had knee replacement surgery last year. "I was so excited I found myself trying to jump."

Kirilenko, Miles and rookie Wesley Matthews all took turns against James, who finished 12-of-20 from the field.

Rather than reclaim his starting small forward position, Miles — who missed Monday's win over Miami due to a viral infection — came off the bench behind Kirilenko with three minutes to go in the opening quarter.

But when Kirilenko headed to the locker room in the third quarter it was Korver, and not Miles, who was first off the bench on the wing, and it was starting shooting guard Ronnie Brewer who found himself having to deal with James.

Miles, though, did play during a fourth quarter in which Utah rallied from five down to win for the fourth time in their last five outings.

Kirilenko hyperextended his knee after stepping awkwardly on the foot of Cavs sub Jawad Williams with just less than four minutes remaining in the second quarter. The one-time All-Star from Russia attempted to play through the injury after halftime, but he exited midway through the third and did not return.

Kirilenko's status for Saturday's visit from Milwaukee — the third outing in a three-game homestand for the Jazz — is uncertain, as it that of Deron Williams.

James, who scored 51 in a 2006 game against the Jazz, had only eight points at the break. Yet the Cavaliers still took a seven-point lead - 47-40 - into the third quarter.

Utah held the Cavs to 13 points in the third — that's the fewest third-quarter points allowed by the Jazz this season — but Cleveland still was up by five, 60-55, heading into the final period.

Utah Jazz rookie guard Sundiata Gaines is cheered after winning the game for the Jazz at the buzzer Thursday night at EnergySolutions Arena. His three-pointer put the Jazz ahead, 97-96. (Jeffrey D. Allred, Deseret News)

The Jazz took their first lead of the second half when Carlos Boozer - who started 0-for-5 from the field - hit two free throws to make it 66-64 with 7:51 to go.

Matthews followed with a 3-pointer, Gaines scored three more the old-fashioned way to cap a 15-0 Jazz run.

Williams re-injured his wrist in the first minute of the fourth, and Gaines — whose second 10-day contract with the Jazz begins today — came in cold to spark the run.

Gaines checked out with just more than two minutes left, yielding to usual backup point Ronnie Price with the Jazz up 85-82.

But he returned for the winner, hitting it after the Cavs missed 3-of-6 free throws in the final 22.2 seconds.

"That (shot) was unbelievable, man," Boozer said. "We tried to have a play that went to the hole, and they did a great job of cutting everything off.

"Yada (Gaines) got the ball in a tough position ... and he made a helluva shot. This place is pandemonium right now. Unbelievable, unbelievable game."

Utah Jazz guard Sundiata Gaines is cheered by teammates after winning the game for the Jazz at the buzzer Thursday night at EnergySolutions Arena. His three-pointer put the Jazz ahead, 97-96. (Jeffrey D. Allred, Deseret News)

NOTES: Price, who didn't play Monday because of tendonitis in his left shoulder, played without the wrap he had on the shoulder during games last week. .. Big man Kosta Koufos was healthy inactive for Utah. ... The Jazz are now 4-1 on major national cable TV this season, including 4-0 on TNT. They're also 4-1 in their throwback green jerseys, which they wore Thursday.