Lefty insurgent Tiffany Cabán cut party favorite Melinda Katz’s lead in the neck-and-neck Democratic primary race for Queens District Attorney to just 16 votes Friday — as their campaigns geared up to battle over 100 tossed provisional ballots in court.

Public defendant Cabán picked up five of six votes from provisional ballots that were re-validated during a contentious Board of Elections meeting in Queens, with Katz, the current Queens borough president, scoring the remaining ballot.

All told, Cabán’s campaign is expected to challenge the BOE’s decision to nix 114 of the 2,500 initially rejected provisional ballots.

The hearing is set for Queens Supreme Court on Tuesday.

The court fight will center on whether to count provisional ballots where voters forgot to sign and swear they were registered Democrats, despite being in the poll books as party members.

Katz now has 34,899 votes compared to Caban’s 34,883, according to tallies provided to The Post on Friday.

The six ballots were re-validated as a result of a voter-registration snafu involving people who were double registered after moving to Queens.

Katz’s lawyer Frank Bolz accused Cabán’s camp of selectively choosing the ballots that are headed to court from districts where she performed well.

“In the event that the court determines that this is not a fatal flaw, I’m reserving my right that it’s the entire county and not just cherry-picking those people that they believe voted for Cabán. It should apply to everyone,” Bolz said in a conference room at the BOE office in Forest Hills.

Cabán lawyer Renee Paradis didn’t deny that logic.

“We absolutely agree. We are interested in opening every party-missing ballot,” she said. “Now yes, we did start in areas where we were strongest.”

She said she doubted whether Bolz would’ve acted differently — prompting him to snipe, “Don’t speak for me. There is not one from southeast Queens, and I find it hard to believe that there was no one in southeast Queens that did not have missing party. This is cherry-picking.”

On Tuesday morning, the New York City Board of Elections will begin the painstaking task of manually counting every single ballot.

Night-of results showed Cabán with an apparent lead over Katz by 1.3 percentage points, or about 1,090 votes.

David Birdsell, a political science professor and the dean of the Marxe School of Public and International Affairs at Baruch College, said it’s likely that the remaining provisional ballots will favor Cabán, while the bulk of the absentee ballots went to Katz — helping her erase a massive 1,100-vote deficit.

“The buzz, the mojo, the excitement, the ability to micro-target voters has been something the progressive left has been able to tap,” Birdsell said. “They’ve just done a better job, but they can’t assume that’s a durable advantage.”

“We’re looking at tiny numbers,” he added. “If you can get 4 PTAs to vote for you at the time and place of your choosing, you could win this election.”

One Democratic source familiar with the race results said establishment favorite Katz managed to catch up to Cabán because of the public defender’s election inexperience.

“They did not have an absentee [voter] program, which requires a fair amount of organization and coordination to get right,” the source said of Cabán’s campaign. “There was a lot of changeover in the campaign at various points.

“Running a campaign for the first time, nobody is prepared for that — and this is a piece of that.”

Provisional ballots are most often cast when the person is not on the official list of registered voters at polling places on Election Day.

“The major reason a provisional gets rejected is because the person is not enrolled in the party,” said Martin Connor, a lawyer specializing in election law. “Another reason they get thrown out is because the person goes to the wrong polling place.”

Name confusion could also be to blame, such as when a married woman goes to vote but her maiden name appears on the BOE’s books, Connor said.