No good seed goes unpunished.

A Manhattan lawyer claims his sister-in-law falsely accused him of sexual assault — because she feared admitting to her family they had slept together to get her pregnant.

Ted McCullough, 47, says in a $7 million lawsuit that his wife’s sister, Adrienne Mesko, 37, couldn’t conceive with her infertile husband.

But instead of going to a fertility clinic or using a sperm donor, the two allegedly took matters into their own hands.

They met in Hyde Park, Dutchess County, where she lives and he has a weekend house, and had intercourse over two days, court papers say.

After their second go at it, court papers describe in unflinching detail, “she pulled her naked legs up in a crab-like position to increase the chances of conception. She then stated to him, ‘Thank you, I know you are doing me a favor.’ ”

McCullough claims he had sex with Mesko out of the goodness of his heart — and out of respect for her husband.

In court papers, he says he had “high regard” for his brother-in-law and felt he’d make a “fine, responsible and upstanding father.”

Mesko repaid McCullough’s “favor” with “bile,” he says in his suit, in which he claims Mesko has “mental disorders,” accuses her of mixing a “cocktail” of fertility drugs with “regular doses of alcohol,” and says she can hold only “low-paying” restaurant jobs despite having a college degree.

But Mesko told the Dutchess County Sheriff’s Office a much different story: that McCullough sexually assaulted her.

No arrests have been made, but “there is an active police investigation into the matter,” Capt. John Watterson told The Post.

Mesko also aired her assault allegation in Dutchess County Family Court, obtaining an order of protection against McCullough — who later obtained one against her.

McCullough claims the accusations nearly ruined his marriage, causing his wife, Deirdre Chiaramonte, a Manhattan veterinarian, to file for divorce. The couple, who have two kids, are trying to reconcile, he says in court papers.

His suit, filed last week in Manhattan Supreme Court, accuses Mesko of defamation, malicious prosecution and intentional infliction of emotional distress.

McCullough, a former Marine, brags about his Midtown law firm in the filing, describing McCullough, Ginsberg, Montano & Partners as a “highly successful” national practice in commercial, contract and environmental litigation.

Mesko, who did not get pregnant, declined to comment on the suit.

She and Deirdre are still on speaking terms, but the incident and McCullough’s suit, has damaged the family, says the sisters’ dad.

“Adrienne has never lied to me,” Gregory Chiaramonte told The Post. “That is unbelievable, his allegation that she asked him to have sex so she could have a baby.”

The case had been dealt with behind closed doors in Family Court, he said.

“I don’t know why he’s bringing it to this level,” the father said.

An attorney for McCullough didn’t respond to questions about the case.