Danilo Gallinari outplayed Carmelo Anthony in the first meeting since they were swapped in a blockbuster trade, scoring a career-high 37 points as the Denver Nuggets outlasted the New York Knicks 119-114 in double-overtime on Saturday night.

Al Harrington, another former Knicks forward, scored 22 of his 24 points after halftime for the Nuggets, allowing them to withstand Anthony’s attempt to rally the Knicks after his poor shooting had them behind until the final minutes of regulation.

Anthony finished with 25 points and 10 rebounds, missing 20 of 30 shots in the Knicks’ sixth straight loss. He missed 14 of his first 17 shots and heard boos, then made his final four of regulation to nearly help New York pull it out.

Anthony spent the first 7 1/2 years of his career with the Nuggets before they granted him a trade.