Marcus Morris made a tiebreaking 3-pointer with 13.2 seconds remaining to delight a Madison Square Garden crowd that booed Kristaps Porzingis all night, and the New York Knicks beat the Dallas Mavericks 106-103 on Thursday.

Morris also knocked away the Mavericks’ inbounds pass with under a second left, sending the Knicks to just their third victory in 12 games this season.

Porzingis finished with 20 points and 11 rebounds in his first game in New York as a visitor. Luka Doncic had 33 points, 11 assists and 10 rebounds in his fifth triple-double of the season.

Dallas Mavericks' Luka Doncic (77) reacts after scoring and drawing a foul during the first half of the team's NBA basketball game against the New York Knicks on Thursday, Nov. 14, 2019, in New York. (AP PhotoFrank Franklin II)

Dallas Mavericks' Luka Doncic (77) reacts after scoring and drawing a foul during the first half of the team's NBA basketball game against the New York Knicks on Thursday, Nov. 14, 2019, in New York. (AP PhotoFrank Franklin II)

Porzingis was the No. 4 pick in the 2015 draft who developed first into a fan favorite and then an All-Star. But he soured on the Knicks, and the fans have clearly soured on him, jeering him when the Mavs hit the floor for pregame warmups, continued during the national anthem, when Porzingis won the opening tip and whenever else he touched the ball in the early going.

More AP NBA: https://apnews.com/NBA and https://twitter.com/AP_Sports

Dallas Mavericks owner Mark Cuban, left, cheers on Kristaps Porzingis, center, as he is announced before the team's NBA basketball game against the New York Knicks Thursday, Nov. 14, 2019, in New York. (AP PhotoFrank Franklin II)

Dallas Mavericks owner Mark Cuban, left, cheers on Kristaps Porzingis, center, as he is announced before the team's NBA basketball game against the New York Knicks Thursday, Nov. 14, 2019, in New York. (AP PhotoFrank Franklin II)

Dallas Mavericks' Kristaps Porzingis (6) shoots over New York Knicks' Frank Ntilikina during the first half of an NBA basketball game Thursday, Nov. 14, 2019, in New York. (AP PhotoFrank Franklin II)

Dallas Mavericks' Kristaps Porzingis (6) shoots over New York Knicks' Frank Ntilikina during the first half of an NBA basketball game Thursday, Nov. 14, 2019, in New York. (AP PhotoFrank Franklin II)

New York Knicks' Dennis Smith Jr., right, defends against Dallas Mavericks' Luka Doncic (77) during the first half of an NBA basketball game Thursday, Nov. 14, 2019, in New York. (AP PhotoFrank Franklin II)

New York Knicks' Dennis Smith Jr., right, defends against Dallas Mavericks' Luka Doncic (77) during the first half of an NBA basketball game Thursday, Nov. 14, 2019, in New York. (AP PhotoFrank Franklin II)