Rafael Montadoca testified Tuesday at the trial of Robert Whitfield, the New York Post reported.
Montadoca was one of five inmates allegedly approached by Whitfield with offers to move their release dates up by getting into the jail computer in return for payoffs.
"The officer said he preferred drugs because he could make more money with drugs," Montadoca said.
Investigators say Montadoca and three other inmates backed out after initially agreeing to pay Whitfield. A fifth cooperated with the investigation, wearing a wire and telling Whitfield he would arrange for him to get cocaine.
Whitfield began working in 1990 as a guard at Rikers Island, New York's jail complex on an island off Queens.
Until he was arrested in 2011, he was known for having perfect attendance on the job.
Ray Liotta sues skin care company over use of likeness
Boston schools pull out free condoms over wrapping complaints