NEW YORK — Yoeli Childs scored 18 points and the game-winning dunk and BYU rallied to beat UMass 63-62 Saturday in their final game of the Barclays Center Classic.

After trailing since early in the first half, Elijah Bryant’s two free throws put the Cougars up 62-61 with 2:01 to play. Payton Dastrup’s putback and Jahshire Hardnett’s free throw made it a three-point game, but Rashaan Holloway’s 3-point play tied it at 61.

After a UMass timeout, Hardnett passed it to Childs, who dunked with four seconds left and the Minutemen’s Luwane Pipkins missed a 3 as time expired.

Bryant scored 18 points and Childs grabbed 11 rebounds for the Cougars (4-2), who outrebounded the Minutemen 42-31 but shot 34.9 percent from the floor to 44 percent for UMass.

Malik Hines’ 3-point play broke a 17-all tie, Carl Pierre and Chris Baldwin made back-to-back 3s, and the Minutemen led 38-28 at halftime after shooting 56.5 percent from the floor (13 of 23).

Holloway scored 13 points with eight rebounds and three blocks and Hines added 10 points for UMass (3-3).