The gunman who shot an elderly churchgoer after beating an attempted murder rap — partly because jurors didn’t trust cops after the Bronx ticket-fix scandal — was found cowering in a closet by detectives, law-enforcement sources said yesterday.

Clark is in a medically-induced coma at Lincoln Hospital, while Carson has stabilized, sources said.

Detectives were hunting for Williams after the double shooting — and found him hiding in the home of his girlfriend’s mother about 6:40 a.m., sources said.

Two witnesses identified him as the shooter, sources said. He was charged with two counts of attempted murder, as well as criminal possession of a weapon and menacing, among other charges.

William was found not guilty last year of an attempted murder in 2009 — after a jury found the testimony of the police to not be credible, since once officer was accused of ticket fixing.

Clark’s family was relieved that the alleged thug was off the streets—but it won’t bring Clark back, they said. “He’s going to have to come to judgment,” said her son Norvill Clark, 34. “I’m happy they caught the guy, but at the same time, I just want my mom to get better.”

During the hearing, Williams said nothing, standing handcuffed while wearing a black hooded sweatshirt and jeans. He claimed he was at home when the shooting happened through a statement by his lawyer.

“It wasn’t me,” he said in the statement. “I wasn’t there, I was home.”

Bail was set at $50,000 during his arraignment yesterday.

“He has a significant criminal record—and he poses a flight risk,” said prosecutor Lisa Davis. “He shot a 67-year-old on the way to church.”

A law-enforcement source said William can use a bondsman to pay only 10 percent if he uses collateral, such as his mother’s house, and has used his family’s resources in the past to make bail for other violent crimes.

The source said bail should have been set much higher.

“That is an insult,” said the source. “The woman is lying in ICU fighting for her life.”