Stanford and Vanderbilt will meet in the championship game of the Diamond Head Classic on Saturday in Honolulu.
The Cardinal defeated Liberty and Vanderbilt beat BYU in their respective semifinal contests.
Spencer Jones had a career-high 25 points and Brandon Angel scored 17, including 10 in the final nine minutes, in Stanford's 79-76 win over Liberty.
Harrison Ingram added 13 points and seven rebounds and Michael O'Connell matched his career-high with eight assists to go along with eight points.
The Cardinal (8-4) trailed 28-15 with less than six minutes left against the Flames in the first half.
"For us, honestly, it's a statement win in some ways," Stanford coach Jerod Haase said. "We were resilient to get back in the game and then really resilient to keep fighting in the second half."
Stanford, which has won two in a row and four of its past five, is led by Jaiden Delaire, who averages a team-high 12.3 points and is second in rebounding at 4.8. Ingram averages 12.2 points and a team-high 6.9 rebounds per game, with Jones adding 9.3 points per game.
However, no other Cardinal player averages more than Angel's and O'Connell's 7.3 points per game.
Vanderbilt (8-4) extended its winning streak to three games with a 69-67 win over BYU behind Scotty Pippen Jr., who scored the Commodores' final 16 points during the last seven-plus minutes and finished with 23 points.
Myles Stute had 14 points and seven rebounds, with Jordan Wright adding 13 points and four rebounds and Quentin Millora-Brown grabbing a game-high 10 rebounds to go along with four points.
"It's the most important game we've played this season because we were able to come out with the W at the end of it," Pippen said. "Everyone stepped up when they needed to.
"We know we can beat teams like this and teams who are even better than this. I don't think confidence is a problem for the team right now. It's just a matter of executing the small things and the details."
Pippen leads the team with 18.1 points, 2.5 assists and 1.8 steals per game, with Wright second on the team with 12.6 points per game to go along with a team-high 6.1 rebounds per game.
BYU (10-3) and Liberty (8-5) meet in the third-place game earlier on Saturday.
--Field Level Media