She’s a traitor to every badge.

A Brooklyn prison guard offered herself up for jail-cell trysts with the convicted killer of two NYPD detectives — intentionally getting pregnant so she could provide the death penalty candidate with a baby to give him “some kind of hope,” federal authorities charged yesterday.

Disgraced federal officer Nancy Gonzalez, 29, is carrying the son of coldblooded killer Ronell Wilson — who faces death by lethal injection for the 2003 execution slayings of Detectives James Nemorin and Rodney Andrews, a criminal complaint says.

“I can’t believe she would be that crazy,” said an ex-detective about eight-months pregnant Gonzalez — who faces up to 15 years in prison if convicted of having sex with Wilson in Brooklyn’s Metropolitan Detention Center.

“It’s outrageous that someone in law enforcement would even talk to this guy, let alone have sex with him. The only thing we can hope for is he gets the electric chair, she’ll be sitting on his lap.”

In 2007, Wilson, 30, was sentenced to die for shooting the undercover cops during a Staten Island gun buy-and-bust operation.

But that sentence was overturned on a technicality. Wilson was shipped last year from federal death row in Indiana back to Brooklyn, where he is fighting efforts to have him re-sentenced to death.

During Wilson’s 2007 trial, a criminal buddy testified about receiving a letter from him, in which Wilson talked about wanting to impregnate a woman before being executed. “I just need a baby before the pigz try to take my life. I need to have something behind,” wrote Wilson.

Wilson and Gonzalez hooked up sometime after late March, the complaint charges.

One inmate told authorities he saw Gonzalez and Wilson “hugging and kissing” in a room next to his cell.

Another inmate said that in April, he “saw Gonzalez standing in front of [Wilson’s] cell with the door propped open when all of the other inmates were locked in their cells.” He saw the female guard move away “and saw [Wilson] standing at the doorway with his pants down, exposing his genitals,” the complaint says.

In a recorded call Gonzalez had with an inmate she began seeing after she got pregnant by Wilson, she said “she had intercourse with [Wilson] over the course of three weekends during which the sole purpose was to impregnate her,” the complaint said.

“I just basically got wrapped up in something that I should not have,” Wilson told her other jail fling.

“There was an inmate there that for whatever reason I took a chance because I was so vulnerable and wanted to be loved, and now I am carrying his child,” Gonzalez told him, explaining that she “kind of got sucked into his world” and “felt like, well, why not give him a child as far as giving him some kind of hope.”

Gonzalez was freed on $150,000 bail after appearing in Brooklyn federal court yesterday, where he lawyer Anthony Riccio told reporters she was remorseful and distraught.

“People fall in love in the strangest places,” Riccio said.

The jailhouse tryst could work against Wilson and his attempt to avoid the death penalty.

Detectives Endowment Association President Michael Palladino said, “This is a sham to defraud the court and avoid justice” — arguing Wilson’s apparent plotting to impregnate Gonzalez “indicates he is competent enough to face the death penalty,” despite his lawyers’ claims that he is mentally deficient.

Brooklyn federal prosecutors wrote a letter on Monday to a judge indicating that they plan to tell the jury at Wilson’s forthcoming penalty-phase trial that he continues to represent a future danger to others, citing his “continued acts of violence, [and] his ability to manipulate prison staff.”