Utah Valley improved to 15-9 overall and 9-2 in the WAC one-half game ahead of New Mexico State in the race for the top seed in the league's postseason tournament.
Stephen Madison scored 42 points for Idaho, which missed a tying free throw and two shots to win in the final 13 seconds.
"A lot of offense, a lot of shot-making," said Utah Valley coach Dick Hunsaker. "... I thought we fought our hearts out."
The game came down to a furious sequence that began with the Wolverines owning an 89-87 lead.
Idaho's Sekou Wiggs was fouled and made his first free throw. He missed the second but Madison squeezed inside for the rebound.
The Vandals calmly got the ball to point guard Glen Dean, who pulled up and missed a jumper with eight seconds to play. Idaho again rebounded, setting up Connor Hill's three-pointer at the buzzer, which also missed.
Asked what he was thinking during those frantic final seconds, Dick Hunsaker said, "You're not thinking; you're praying."
Utah Valley center Ben Aird said simply, "It's a blur."
After trailing almost all the way, Utah Valley took an 87-83 lead with 2:26 remaining when Holton Hunsaker came off a screen and buried a long three-point shot.
Idaho refused to go away, however.
Madison scored from underneath with 1:26 left before the Wolverines' Hayes Garrity buried two free throws.
Down 89-85 with 1:06 to play, Madison went to the basket again to keep the Vandals in the game.
"Madison had a fabulous game," Dick Hunsaker said. "... Idaho did a great job tonight of coming in [and trying] to take us down."