Huestis scored 16 of his points after halftime for the Cardinal (16-11, 7-7 Pac-12), who had lost three of its previous four games.
Dwight Powell had 14 points and 11 rebounds for Stanford.
Oregon State closed within 73-69 after Roberto Nelson's outside jumper with 2:41 left. Stanford answered with an Aaron Bright 3-pointer and a Powell dunk to go back ahead 78-69 with 1:09 left. The Beavers got no closer than six from there.
Chasson Randle and Andy Brown scored 13 for Stanford, and Aaron Bright had 12 points and six assists.
Nelson had 28 points to lead the Beavers (13-14, 3-11), who remain in a tie for 10th with Utah.
Joe Burton had 16 points and eight rebounds for Oregon State, and Eric Moreland had 11 points, 11 rebounds and three blocked shots.
The Cardinal never trailed after a 7-0 run, capped by Bright's lay-in, gave them a 43-37 lead early in the second half. A long jumper by Huestis extended the Cardinal advantage to 49-42 with 15:18 remaining.
Oregon State closed within two points twice before Brown converted a conventional three-point play to make it 54-49.
The Beavers got within two twice more before Stanford opened up a 63-56 lead on Bright's 3-pointer with 8:33 remaining.
Randle and Brown each made one of two free throws, then Powell finished a
Stanford shot 48 percent while Oregon State made 43 percent from the field. The Cardinal had a 40-37 rebounding average.
Randle had 10 of Stanford's first 18 points, including a lay-in to cap a 13-2 run that gave the Cardinal an 18-13 lead.
Stanford took its biggest lead of the half at 25-18 on a short jumper by Robbie Lemons with 9:13 left.
Oregon State scored the next five points, the last three by Devon Collier. The Beavers tied it at 27 when Burton found Collier for a lay-in.
Nelson's short fadeaway jumper in the closing seconds of the half gave Oregon State a 35-34 lead at the half.
Burton and Randle were the leading scorers in the first half with 12 points apiece.