It took only an hour to get a Wyandanch teenager to admit he’d shot up a house and killed a man, a Suffolk homicide detective testified Tuesday in a pretrial hearing in Riverhead.

The hearing before state Supreme Court Justice Mark Cohen is to determine whether statements made in 2010 by Gabriel Hubbard, now 23, will be admissible at his second trial on a charge of second-degree murder.

Hubbard’s conviction was reversed because the judge who presided over that trial found that prosecutors had failed to alert the defense that the same detectives who got Hubbard to sign that confession had produced a discredited confession from a cabdriver shot by an off-duty Nassau County officer in Huntington Station.

State Supreme Court Justice Martin Efman had ruled that if the jury had known about that, it might have acquitted Hubbard. Eight of the jury’s nine notes during deliberations concerned the legality of the statement.

There is no physical evidence linking Hubbard to the crime, making the confession the key piece of evidence in the case.

Det. Ronald Tavares said he and his partner, Charles Leser II, went to Greensboro, N.C., two years after Jaquan Jones had been shot to death in an apparent gang dispute. The detective testified that others involved in the dispute had told detectives that Hubbard, then 15, was the shooter. Tavares said Hubbard broke down and confessed after Tavares showed Hubbard a written statement from Daquan Cannon, who described himself as the lookout.

advertisement | advertise on newsday

Coincidentally Tuesday, Cannon pleaded not guilty to drug sale charges in the same courtroom moments before the hearing resumed. His attorney, John LoTurco of Huntington, said he knew nothing about Cannon being involved in the death of Jones. No one else was ever charged in the death.

In the statement Hubbard signed, he said he was a member of the Over Thugged Out gang, which was fighting with the rival Brave Heart gang. After a fight between gang members, Hubbard’s statement said he intended to send a message by shooting at the Brave Heart house on North 18th Street.

“I didn’t even notice anyone was out front,” the statement said. “I just wanted to air out the house, which means shoot at it.”

During questioning by Assistant District Attorney Peter Timmons, Tavares said Hubbard also signed photos of the house and drew a diagram of the crime scene for him.

Tavares said he never threatened Hubbard and Hubbard never asked for an attorney.

Hubbard’s defense has said that Tavares and Leser bullied Hubbard into signing a false statement, just like they did in 2011 to cabdriver Thomas Moroughan, who was charged with assault based on a statement later acknowledged by Nassau police’s Internal Affairs to be suspect. The charges against Moroughan were later dropped.

Tavares, during cross-examination by defense attorney JoAnn Squillace of Jamaica, Queens, said he believed he had probable cause to arrest Cannon and others involved in the shooting. But he said the prosecutor at the time, James Chalifoux, advised him not to arrest anyone but Hubbard. No one else was ever charged.