Queens district attorney candidate Tiffany Cabán’s last-ditch bid to get disqualified votes counted in the razor-thin Democratic primary was all but sunk Wednesday as a judge wouldn’t commit to counting them.

That news came a day after the Board of Elections, which already certified the race in favor of her opponent, Borough President Melinda Katz, testified that Cabán’s appeal should be dismissed.

The insurgent’s lawyers are desperately trying to close a 60-vote gap separating her from Katz following a recount of the initially too-close-to-call primary election on June 25.

There were just 114 ballots in contention as both sides headed into Queens Supreme Court on Wednesday — but as the parties cleared out for the day, Supreme Court Judge John Ingram had only agreed to consider counting 28 of them, leaving no apparent path to victory for Cabán.

Both Katz’s camp and the BOE say Cabán’s team was late in appealing many of the uncounted ballots. Ultimately, only 36 were filed by the July 5 deadline. Six were counted at the time, narrowing Katz’s lead to 16, and two were deemed invalid — leaving 28 that remain in question.

“It’s over. The board is at a loss at this point what petitioner Cabán is complaining about,” said Board of Elections lawyer Stephen Kitzinger. “It’s too late to object to ballots before the court. This case should be dismissed.”

Cabán is also seeking to have 22 valid Katz votes tossed and simultaneously get 21 Cabán votes counted after they were previously invalidated.

“The Cabán camp is doing everything they can to turn the electoral process upside down to change the results of the primary,” Katz’s side said in a statement following the hearing.

“After shouting from the rooftops for months that every vote should count, they are now moving to disqualify 22 votes cast for Melinda Katz. Their efforts are akin to throwing spaghetti at a wall and hoping something sticks.”

Cabán’s people argued that it was Katz and the BOE who were grasping at straws.

“The Katz campaign and the Board of Elections seems to be trying to throw up whatever kinds of arguments they can so that ballots are not counted,” said Cabán election lawyer Jerry Goldfeder.

“I’m not sure I understand why the Board of Elections feels that it needs to be as defensive as it is, but our goal is to make certain as best we can that the judge reviews the invalid affidavit ballots, the invalidated affidavit ballots that should not have been invalidated and that they are all open.”