The Cardinal held a three-point lead with 2:46 left in the five-minute overtime when Stanford's John Gage sank a three-point shot to effectively put the game away.
It was Gage's third three-pointer of the day, and he finished with 12 points overall. Stanford was led by Chasson Randle with 17 points and Josh Huestis with 16 points.
USC was led by Byron Wesley with 18 points, while Pe'Shon Howard and J.T. Terrell each scored 13 points.
The victory lifted Stanford's record to 13-6 overall and 4-3 in Pac-12 Conference play. The Trojans fell to 10-10 and 1-6. Their first Pac-12 win of the season came in their previous game against California.