Daejon Davis added a season-best 22 points for the Cardinal (7-8, 1-1), who have beaten the Bruins three of the past four meetings at home.
Aaron Holiday scored 31 points, 29 after halftime, and hit a three-pointer at the buzzer of the first overtime to tie the game at 94 and give UCLA (11-4, 2-1) new life.
Michael Humphrey, who finished with 14 points, sank a pair of free throws early in overtime to give Stanford its first lead since 32-30 late in the first half.