Victor Wembanyama nearly delivered a stunning comeback for San Antonio, but his final shot fell short and the Spurs are headed to New York in a deep hole.

Wembanyama’s 17-footer at the buzzer missed, and the New York Knicks escaped with a 105-104 victory Sunday night to take a 2-0 lead in the NBA Finals.

San Antonio trailed by 14 midway through the fourth quarter before storming back with 14 straight points. Wembanyama’s three-point play with 57 seconds remaining gave the Spurs a 104-102 lead — their first in nearly two quarters.

But the Spurs could not close it out. Wembanyama committed a turnover in transition while trying to connect with Stephon Castle in the final seconds, then got one last chance and missed the potential winner at the horn.

The loss spoiled a furious rally and left San Antonio facing an 0-2 deficit as the series shifts to New York, where three of the next five games, if necessary, will be played at Madison Square Garden.

The Knicks extended their playoff winning streak to 13 games behind timely shot-making from Karl-Anthony Towns and Mikal Bridges after a dominant second quarter erased another early Spurs advantage.