Allen scored four of his 10 points in the final four minutes and grabbed three of his game-high 11 rebounds in the same span as
Randle scored 17 points, Stefan Nastic added 15 and Anthony Brown and Rosco Allen added 11 points apiece for the Cardinal (16-7, 7-4 Pac-12), who ended a two-game losing streak.
"It kind of just happens," Marcus Allen said. "I try to pick everybody up on defense and get them energized. I try to do the small things that don't show up on the stat sheet."
Katin Reinhardt scored 19 points and Jordan McLaughlin added 18 for the Trojans (9-14, 1-10), who lost their eighth straight.
"I thought it was a really good college basketball game," USC Coach
An offense goal-tending call on a Nastic basket gave Stanford a 65-59 edge with 3:31 left to play and the Trojans never got closer than four the rest of the way.
"Marcus does one thing one night and something different the next night," Stanford Coach Johnny Dawkins said. "If he can put it all together, he's capable of having a great career here."
The Cardinal opened the second half with a 13-4 run to wipe out a six-point halftime deficit. An offense rebound led to Randle's lean-in jumper with 13:53 remaining that put Stanford ahead.
"I'm impressed with the win," Randle said. "They gave us everything they had and we had to give them everything we had."
Marcus Allen's lay-up with 6:28 left in the first half to put Stanford ahead, 27-20. The Trojans outscored the Cardinal 19-6 the rest of the way to take a 39-33 advantage into intermission.
"We need everybody," Dawkins said. "Losing two in a row was a difficult pill to swallow. We had to figure out a way to get back on track."
USC post player Nikola Jovanovic was limited to 18 minutes because of foul trouble. The Cardinal took advantage with a 50-35 rebounding edge.