Tyler Bey added 16 points and 10 rebounds, and D’Shawn Schwartz had 15 points for the Buffaloes (13-9, 4-6).
The Bruins (12-11, 5-5) led just once on a jumper by Cody Riley early in the second half.
Gatling immediately took over and hit three straight 3-pointers to put Colorado back in front 52-47.
UCLA closed to 60-59 on a 3-pointer by Jaylen Hands before the Buffs controlled the game’s final nine minutes when they outscored the Bruins 26-15.
Colorado hit 13 3-pointers in the game, made 15 of 16 free throws and had 22 assists on 28 made field goals.
Moses Brown led UCLA with 17 points, going 8 of 10 from the floor. Chris Smith added 14 points and Hands added 13. Leading scorer Kris Wilkes was held to eight points on 3 of 11 shooting. He averages 17.8 points.
The Buffs raced to a 20-8 lead to open the game, making four 3-pointers during the stretch in which UCLA trailed by 13.
The Bruins eventually recovered, ending the half on a 9-0 run to trail 38-37. Hands stole the ball and fed Smith for a basket. Brown blocked Schwartz, grabbed the rebound and fed Hands for a 3-pointer.
Colorado: Halfway through Pac-12 play, the second-through-10th-place teams are tightly bunched. The Buffs have an advantage with five of their final nine regular-season games at home, where they are 8-2 overall.
UCLA: The Bruins’ funk continues. Their second straight loss dropped them to .500 in league play as they fell to 5-5 under interim coach Murry Bartow.
Colorado: At Southern California on Saturday.
UCLA: Hosts Utah on Saturday.