Ayton's layup with 7:33 remaining gave the Wildcats (13-4, 3-1 Pac-12) the lead for good, beginning a 16-3 run that put Arizona in control.
Arizona forward Rawle Alkins had 11 points, including seven in the final 7 1/2 minutes, when the Beavers never got closer than seven.
Forward Tres Tinkle had 18 points and nine rebounds and Stephen Thompson Jr. scored 12 points for the Beavers, who had won eight of their past 10.
Oregon State (10-6, 2-2) shot 39.3 percent from the field and had its fewest points of the season. Its previous low was 63 in a victory over St. Louis.
Ayton grabbed 10 rebounds and Arizona's Dusan Ristic had eight points and eight rebounds. Drew Eubanks finished with eight points and five rebounds for the Beavers.
The Wildcats shot 41.5 percent from the field, including 6 of 21 on 3-point attempts. The Beaves made 6 of 14 tries from beyond the arc.
Trier, who scored a total of 15 points in two road games last week, made 4 of 9 from long distance.
Oregon State scored 12 of the first 14 points of the game, and Arizona did not take its first lead until a Trier dunk three minutes into the second half made it 27-26.
Tinkle hit his third 3-pointer during a 9-2 run to put the Beavers back in front 35-31 lead, and the game went back-and-forth until Ayton's layup began Arizona's decisive run.
Tinkle made four of the Beavers' six 3-pointers two coming as Oregon State took a 12-2 lead.
Oregon State had a 22-21 lead at halftime. Neither team scored in the final three minutes of the half, and the Beavers did not score in the final 5 1/2 minutes.
The Wildcats played their first game since coach Sean Miller said, "I have a hard time reaching our guys" following an 80-77 loss at Colorado on Saturday.
Ayton and Trier were selected to the Wooden Award list midseason top 25 this week.
--Field Level Media
Oregon St. | Arizona | |
Tres Tinkle 18 | Scoring | Allonzo Trier 21 |
Drew Eubanks 2 | Assists | Parker Jackson-Cartwright 5 |
Tres Tinkle 9 | Rebounds | DeAndre Ayton 10 |
Ethan Thompson 2 | Free Throws Made | Allonzo Trier 5 |
Stephen Thompson Jr. 3 | Steals | Rawle Alkins 3 |
Drew Eubanks 2 | Blocks | Ira Lee 2 |
Team | Points | FG% | 3PM-3PA | FTM-FTA | Assists | Rebounds | Blocks | Steals | Turnovers |
Oregon St. | 53 | 39.3 | 6-14 | 3-8 | 7 | 31 | 2 | 5 | 15 |
Arizona | 62 | 41.5 | 6-21 | 12-16 | 14 | 33 | 4 | 9 | 12 |