A private investigator from Shoreham has been accused of bribing a former New York City police sergeant from Kings Park for information about possible witnesses in a confidential federal law enforcement database.

Joseph Dwyer, 46, of Investigative Resource Group, and 48-year-old Ronald Buell, who has since retired from the NYPD, were arrested on charges of bribery, unauthorized database access and participating in a conspiracy to commit bribery and to access a federal database without authorization. Dwyer was also charged with mail fraud. Both pleaded not guilty Wednesday at Manhattan federal court.

“Private investigators assisting criminal defendants can – and should – do many things to serve their clients, but bribing law enforcement officials for confidential data is not one of them,” Preet Bharara, U.S. Attorney for the Southern District of New York, said.

Prosecutors said Dwyer paid Buell $9,000 for Buell to access the National Crime Information Center (NCIC) database on at least 15 occasions to obtain info on witnesses and other individuals associated with at least 11 federal criminal prosecutions between 2011 and ’13 while Buell was still on the force.

The NCIC, which is run by the FBI, is not publicly available because the disclosure of certain information in the database can jeopardize law enforcement operations and safety, authorities said.

At the same time, Dwyer was billing the federal government for his services as a private investigator regularly hired by court appointed attorneys for poor defendants in Manhattan federal court, according to prosecutors.

Dwyer faces up to 45 years in prison and Buell faces up to 25 years.