Hillary Clinton and Sen. Bernie Sanders of Vermont will square off Thursday as the attacks on the campaign trail sharpen and the window for dramatically changing the race for the Democratic presidential nomination shrinks.

Combined, it adds an urgency to their debate, slated for 9 p.m. at the Brooklyn Navy Yard. The forum is sponsored by CNN and will be carried on both CNN and NY1.

Set in one of the most Democratic parts of New York State, the debate offers Clinton and Sanders one last head-to-head meeting before the state’s Tuesday primary. Polls show Clinton with a 10- to 14-percentage-point lead, but that margin has been declining.

For Clinton, the task in the debate is to continue showing she is the most qualified, that she remains popular in a state she represented as senator, and that she’s the Democrats’ best chance at winning the White House, experts said.

Sanders must seize the momentum — he’s won seven straight primaries, though in states with way fewer delegates at stake than New York. He must not concede any region to Clinton and show that he’s making inroads here, experts said.

Democratic presidential candidate Bernie Sanders speaks after being endorsed by the TWU Local 100 in Brooklyn, April 13, 2016. Photo Credit: Craig Ruttle

Next to California, New York offers the most delegates for candidates to accumulate in the remaining primaries, and that makes the stakes Thursday higher. That could be reflected in the tone of the debate, noted Matt Hale, a Seton Hall University political scientist.

advertisement | advertise on newsday

“You’ve seen, with Clinton and Sanders, an uptick of the attacks. They’re going after one another in ways they hadn’t been until recently,” Hale said. “Those lines of attack are going to crystallize in the debate.”

Clinton and Sanders have traded barbs over presidential qualifications, gun laws and guns brought from Vermont to New York, as well as big banks and her speeches before financial institutions.

Hale said the “uptick” reflects, in part, the shortening of the political calendar.

“There is not much remaining time to make big changes in the race,” Hale said.

Clinton has done a good job as presenting herself as the most qualified candidate and needs to continue that approach in the Brooklyn debate, said veteran Democratic strategist William Cunningham. She’ll also have the advantage of reminding votershe was twice elected senator in New York.

But some polls are showing upwards of 20 percent of enrolled Democrats haven’t solidified their choice yet — which probably isn’t good for Clinton, Cunningham said.

“Whomever is undecided at this point probably isn’t voting for Hillary,” he said.

That’s part of why Sanders “hasn’t ceded” ground to her in New York. He picked up the endorsement of a transportation union Wednesday — most unions in New York have backed Clinton. Also, he’s launched a series of ads to woo Democrats to sign on to his “political revolution,” some featuring African-Americans — who are considered Clinton’s strongest backers.

“Sanders in contest after contest has shown himself to be a very strong finisher,” Cunningham said. “He’s done it time and time again. He’ll be looking to motivate his voters to come out and not pay attention to any of these polls. He’ll be punching away.”