A top inspector general in Gov. Cuomo’s administration is blowing the whistle on a boss who headed her agency, claiming he engaged in harassment and other misconduct.

Patricia Gunning, who recently resigned as the special prosecutor/inspector general of the Justice Center for the Protection of People with Special Needs, said she decided to go public after Cuomo Chief of Staff Melissa DeRosa last week recounted her personal bouts of being subjected to sexism.

“As a longtime sex-crimes and special-victims’ prosecutor, and as an employee who paid a high price for whistleblowing about an executive at a New York State agency for inappropriate behavior with a female subordinate, along with workplace violence directed at me for personally calling him out, my hope is that this conversation will be the beginning of a new era in [how] these issues are addressed by employers,” Gunning, who was the No. 2 official at the Justice Center, said in an e-mail to The Post.

Gunning, who previously prosecuted sex crimes in the Rockland County and Brooklyn district attorney’s offices, identified the alleged subject of her complaint as then-Justice Center head Jay Kiyonaga.

She said she was “terrified” to make a complaint — and the response justified her fears because officials “swept it right under the rug.”

“The wagons circled, the executive was ‘spoken to’ and I was subjected to a subtle and carefully executed pattern of retaliation, done with a clear message: That’s what you get for speaking up,” Gunning said. “My staff was cut without explanation, I was iced out of meetings and endured months of elusive punishment.”

Meanwhile, Kiyonaga was “promoted into a top-level position with” the Office for Persons with Developmental Disabilities.

Gunning also provided The Post with a copy of a June 9 e-mail she sent to Kiyonaga complaining about his alleged abusive behavior toward her during a meeting in her office.

“Screaming and cursing loudly enough and for such a considerable amount of time that my staff was concerned for my well-being and my safety demonstrates your lack of ability to handle important issues effecting prosecutions in a professional manner,” Gunning said in the e-mail to Kiyonaga.

“This clearly has little to do with the issues that we are working through as an agency, and more of an escalating pattern of behavior directed at me,” Gunning wrote. “Given the number of staff that witnessed this behavior, you might consider addressing your inappropriate conduct with them. As for me, I expect it to stop, now.”

She resigned in August.

A spokeswoman for the Justice Center dismissed Gunning’s complaints as “without merit.”

“Each of the complaints described to you were investigated — one by our Counsel’s Office, the other by an outside entity, and the Governor’s Office for Employee Relations — and both were found to be without merit,” said Justice Center spokeswoman Christine Buttigieg.

Kiyonaga declined to comment.