The New York City psychiatrist accused of running an illegal pill mill out of his rented Fifth Avenue office claimed he was an expert on men’s sex lives and co-wrote a book on the subject back in the 1970s called “Beyond the Male Myth.”

But Dr. Anthony Pietropinto apparently couldn’t balance his own books, his co-author told NBC News on Thursday.

“He was a sweet, generous good guy, but he was not a good businessman,” Jacqueline Simenauer said. “It’s upsetting to me to hear that he’s involved in selling drugs. That’s not the man I knew. I think he was just being kind to people.”

Pietropinto, 80, “claimed to have had financials problems during the time he was prescribing medically unnecessary controlled substances in exchange for cash,” DEA Special Agent Kenneth McGrail wrote in the complaint against him.

Pietropinto, who records show filed for bankruptcy in 2015, was one of five New York doctors who were charged by Manhattan federal prosecutors Thursday with flooding the state with 8.5 million oxycodone pills.

“These doctors were drug dealers in white coats,” Geoffrey Berman, the U.S. Attorney for the Southern District of New York, said in a news conference.

Pietropinto charged patients $50 to $100 per visit at his office, which was located in the same building that houses part of The New School, the non-profit research university based in the Greenwich Village neighborhood.

But Pietropinto was savvy enough to instruct his patients “not to fill the prescriptions at large chain pharmacies” because he knew they would question why he was writing prescriptions for so many pain pills, the complaint states.

From October 2012 until May 2018, Pietropinto wrote prescriptions for more than 600,000 Oxycodone 30-milligram tablets to some 214 patients, according to the complaint. One of Pietropinto’s patients died of a drug overdose, the court papers say.

Pietropinto, who got his medical degree at Columbia University and lives with his wife in a Fifth Avenue apartment building only a few blocks south from his old office, disconnected his phone and could not be reached for comment.

Last year, however, Pietropinto was questioned by a reporter from PIX 11, a local New York City television station, about why he prescribed oxycodone pills to a patient who had just completed a drug rehabilitation program.

“We have an MRI on file,“ the psychiatrist said. “I didn’t know she was in rehab.”

Doctors accused of doling out opioids for cash have been known to cover their tracks by insisting that patients bring an X-ray or some other documentation to justify getting a painkiller prescription.

Simenauer, who now lives in Florida, said she was working for the National Enquirer and assigned to the “shrink” beat when she met Pietropinto in the late 1960s.

“I used Tony in a lot of interviews,” she said, describing him as a “strait-laced guy.”

“When I left to start a literary agency, I had the idea to do the myth book and I approached him,” Simenauer said. “After a while he said it was too much work for just him so I helped. He was a sweet and generous guy and the book was very successful.”

Touted as “the most extensive look at the sexual attitudes and practices of American men since Dr. Alfred Kinsey’s famous study in 1948,” the collaboration was dismissed as a “collection of tattle and platitude” in a March 1978 New York Times review.

Simenauer said she and Pietropinto did two more books together and stayed in touch sporadically over the years.

“He never changed,” she said. “He was proud of the fact that he would charge patients just $50 a visit. Who does that in New York City? I think he was taken advantage of and that’s why he has no money.”