USC (10-9, 1-5) rattled off five straight points in the final 1:30 of regulation on Sunday to force overtime hosting Stanford (12-6, 3-3).
Pe'Shon Howard drained a three and Byron Wesley capitalized on a Cardinal turnover by draining two free throws after being fouled going to the rim.
The Trojans were unable to keep pace with Stanford in overtime. The Cardinal scored first in OT and never surrendered the lead.
The 79-71 loss drops USC to 1-6 in the Pac-12, 10-10 overall.
"That was a tough game," USC coach Andy Enfield said after the loss. "We had our chance to win.
Cardinal rally in OT
Stanford outscored USC 18-10 in overtime behind a seven-point effort from Chasson Randle.
"Stanford made plays in overtime to win it," Enfield said. "Randle is an all-league player and he played like it in overtime."
Trojan guard Pe'Shon Howard was tasked with guarding Randle much of the game. He held the Cardinal leading scorer to ten points in regulation.
"I tip my hat to Randle," Howard said after the game. "I let him off the hook in overtime. He did a great job of controlling the game."
The Trojans were within three with 3:33 to play after a Wesley three-point basket, but a pair of Cardinal free throws and a wide open John Gage nailing a three of his own, effectively gave Stanford the momentum and eventually the game.
"We played really hard and had a chance to win," Enfield said. "As a coach, that's all you can ask for. In overtime they made tough shots and we missed some easy ones.
"I'm proud of our team's effort. We need to keep getting better."
Gavrilovic sparks off bench
Trojan forward Strahinja Gavrilovic provided USC a spark, once again, off the bench. He scored a career-high 12 points in his 28 minutes played against the Cardinal.
"Strahinja played very hard," Enfield said. "When he gives that energy level and plays that hard he need to be on the floor. I'm very proud of him. He's worked like crazy to be in this position."
"That was a very tough game," Gavrilovic said. "We played so hard all game, we really wanted to win the game."
Over USC's last five games, the sophomore has scored 35 points. He scored just 21 points in the Trojans first 15 games of the season.
Howard's play improving
USC guard Pe'Shon Howard played a pivotal role in the Trojans' upset win over California on Wednesday.
The senior was back at it Sunday against Stanford. As the starting point guard, he scored 13 points, grabbed seven boards and chipped in six assists.
He also made seven a career-high seven steals.
Both Oregon schools currently sit in the bottom half of the Pac-12 standings.
"This is the Pac-12," Enfield responded to the difficulty of his conference schedule. "We'll take [Monday] off and prepare for our road trip."
Although they only have one conference win, USC players seem confident about their ability to show improvement.
The Trojans lost their first five Pac-12 games by double-digit margins.
Since the first five, they beat California 77-69 and lost to Stanford by eight in overtime.
"We need to keep working," Howard said. "These last two game are better than the previous five. We need to learn from it and try to get some big wins on the road."