Ingram wasn’t wearing robes, but the back room of the Board of Elections’ Queens outpost was a de facto courtroom nonetheless, complete with a plastic chair gallery and office tables for the judicial bench and attorneys’ desks.

The “courtroom” was occupied by lawyers from the campaigns of Katz and Cabán, and the BOE, which rarely has a contest drag on this late past voting day, which in this case was June 25.

The three legal teams engaged in intense debates over “squiggles,” “scribbles,” an intentionally drawn L, wavy lines and other “stray markings” that made the voters’ intent uncertain or otherwise prompted the BOE to disqualify the ballot.

The affidavit ballots that were missing party affiliation were determined not to be “substantially compliant” with existing state election law. A bill that passed the state legislature earlier this year would enable those ballots to be counted, but Gov. Andrew Cuomo has not yet signed it into law.

The attorneys also argued over another 42 invalidated ballots that the Cabán team challenged, 28 ballots that the Katz attorneys contested and one additional ballot that was not counted in the July 3 tally of absentee and affidavit ballots deemed valid by the BOE.

One lengthy exchange illustrated the complexity of the process and, ultimately, the subjectivity involved in determining a voter’s intent.

A ballot featured a line that crossed Cabán’s bubble, as well as the bubble for Jose Nieves, another candidate. The BOE initially invalidated the ballot as an “overvote” because a substantial portion of two bubbles were filled in. Katz’s attorney Frank Bolz cited election statues to argue for the ballot’s banishment.

“Only a quarter, less than a quarter” of Cabán’s bubble was filled in, Bolz said. “Everything else is in Nieves … in essence this is an overvote.”

Goldfeder disagreed and said the voter clearly intended to choose Cabán. The rest of the line that stretched into Nieves’ bubble was a stray marking, he said.

Ingram sided with Goldfeder on this occasion.

“Obviously the intent of the voter was to vote for Cabán because the line started in the middle” of the bubble next to her named,” Ingram said, even though, he added, “85 percent of the line” was in Nieves’ bubble.

Early in the day, Cabán picked up another vote to narrow the seemingly insurmountable deficit.

“We’re chipping away,” Goldfeder quipped.

A separate contested ballot featured a vote for Katz — and a mysterious yellow stain.

Ingram said it looked like mustard — a stray condiment perhaps, but not an identifying mark. He ruled that the vote counted for Katz.