USC's Jordan McLaughlin had seemingly given the visiting Trojans a two-point victory with a twisting reverse layup with three seconds remaining before Stanford wisely inbounded the ball 30 feet ahead to Davis, who took one dribble and cast his game-winner from beyond half court.
The dramatic win completed a two-game weekend sweep for the Cardinal (8-8, 2-1), who went two overtimes to turn back UCLA 107-99 on Thursday night.
The loss gave the Trojans (11-6, 2-2) a split of games in the San Francisco Bay Area, having beaten Cal 80-62 on Thursday.
Stanford never led in the second half until Davis finished off a 6-0 run with a layup that produced a 74-72 advantage with 1:43 to play.
USC's Chimezie Metu countered with a jumper, forging a 74-all tie that held until McLaughlin's layup with three seconds left.
Reid Travis had a game-high 29 points and 10 rebounds, Michael Humphrey added 15 points and Kezie Okpala 11 for Stanford, which for the second straight game rallied from a big deficit.
Metu totaled 20 points, Nick Rakocevic 17, McLaughlin 16 and Bennie Boatwright 13 for USC. Boatwright was the game's leading rebounder with 11.
Stanford was down by 11 at halftime and 68-53 near the midpoint of second half before rallying.
Oscar da Silva's 3-pointer with 6:21 to play capped a 12-0 spurt that got the Cardinal within 68-65.
The Cardinal were still down four with under three minutes to go before baskets by Travis and Okpala tied the score and set the stage for Davis' go-ahead layup with 1:43 left.
Stanford scored the game's first seven points, but USC responded with seven 3-pointers in the final 15 minutes of the first half, propelling the Trojans into a 47-36 lead.
McLaughlin had a pair of 3's in an early 11-0 burst that erased Stanford's lead. He and Boatwright each had one late in the half, when the Trojans pulled away into their double-digit lead.
McLaughlin had 14 of his 16 points in the half.
--Field Level Media
Southern California | Stanford | |
Chimezie Metu 20 | Scoring | Reid Travis 29 |
Jordan McLaughlin 7 | Assists | Daejon Davis 6 |
Bennie Boatwright 11 | Rebounds | Reid Travis 10 |
Jonah Mathews 2 | Free Throws Made | Reid Travis 9 |
Jordan McLaughlin 4 | Steals | Kezie Okpala 3 |
Chimezie Metu 3 | Blocks | Oscar Da Silva 2 |
Team | Points | FG% | 3PM-3PA | FTM-FTA | Assists | Rebounds | Blocks | Steals | Turnovers |
Southern California | 76 | 46.4 | 8-21 | 4-6 | 13 | 31 | 3 | 7 | 10 |
Stanford | 77 | 49.2 | 5-22 | 10-15 | 14 | 34 | 3 | 6 | 11 |