Josh Christopher added 15 points and Marcus Bagley, Jalen Graham and Alonzo Verge Jr. scored 12 apiece for Arizona State (6-8, 3-5 Pac-12).
Christopher hit a 3-pointer and Kimani Lawrence made two free throws to give the Sun Devils a one-point lead with 1:46 to play. Michael O'Connell made a short jumper on the other end 29 seconds later, but Lawrence was fouled as he made a layup and converted the three-point play before Verge hit two free throws to cap the scoring as ASU closed on a 10-2 run.
The Sun Devils have won back-to-back games following a six-game losing streak.
Jaiden Delaire tied his career-high with 21 points and Oscar da Silva had 18 points and 11 rebounds for Stanford (10-6, 6-4).
Arizona State made 29 of 58 from the field and scored 29 points off 20 Stanford turnovers.
Delaire - who tied his career best for points for the second consecutive game - and da Silva combined to score 14 points in a 17-6 run that gave the Cardinal a 73-69 lead with 2:58 to play. They went 1 for 3 from the field with two turnovers the rest of the way.
Stanford made 31 of 34 from the free-throw line but hit just 2 of 15 (13%) from 3-point range.
For more AP college basketball coverage: https://apnews.com/Collegebasketball and https://twitter.com/AP--Top25
Christopher gets the steal and slams with authority
Arizona State's Josh Christopher shows out on both ends as he gets the steal and goes the other way for a dunk.