Arizona (20-5, 8-4 Pac-12) stumbled through a lackluster first half at both ends to trail by 10. The Wildcats tightened up defensively in the second and took advantage of UCLA's foul trouble to wear down the Bruins.
UCLA won the first meeting 87-84 on Jan. 7 at Pauley Pavilion when Alford hit a 3-pointer with 1.8 seconds left
The Bruins have struggled since then, losing four of seven, including an 80-61 blowout by rival Southern California.
The Wildcats head into the final stretch of the regular season finally healthy.
Arizona played eight games without Tarczewski (foot) early in the season and seven without Trier, who had seven points in 16 minutes against Washington last week in his first game back.
UCLA controlled the rematch early, effectively working the ball around as Arizona struggled with the Bruins' ball screens.
Hamilton hurt the Wildcats from the perimeter, scoring 11 points in the opening 10 minutes, and the Bruins repeatedly got the ball inside Arizona's slow-rotating defense for easy baskets at the rim.
UCLA continued to find gaps in Arizona's defense, going on a 17-4 run and hitting 17 of 32 shots to lead 44-34 at halftime.
Arizona was impatient on offense, settling for jump shots instead of getting the ball inside or to the rim. The Wildcats made five shots inside the 3-point arc and were outscored 22-10 in the paint in the first half.
The Wildcats tightened up defensively in the second half, rotating better and challenging nearly everything at the rim.
Trier ditched the brace on his right hand in the second half and scored nine quick points, highlighted by an alley-oop dunk on a feed from York and a long 3-pointer to beat the shot clock to pull the Wildcats within four.
Arizona continued to chip away at the lead, finally taking it at 60-59 on Anderson's putback off a missed free throw.
The Wildcats' ability to draw fouls in the first half began to cause problems for UCLA late in the second. Welsh fouled out with about 6 1/2 minutes left and Parker was right behind him after re-entering the game.
Even without their two big men, the Bruins kept up with the Wildcats, hitting one clutch shot after another.
The Wildcats hit the biggest ones down the stretch: a 3-pointer by Jackson-Cartwright and York's three-point play with 54 seconds left to cap a 9-0 run that put Arizona up 78-70.
UCLA: Hamilton scored in double figures in 20 straight games, longest by a UCLA player since Kevin Love did it in all 39 games of his freshman season in 2007-08.
Arizona: PG Kadeem Allen was limited to four points while playing sick. ... Jackson-Cartwright had four assists.
UCLA plays at Arizona State on Sunday.
Arizona hosts No. 23 USC on Sunday.