Sources directly connected with Lawrence Taylor tell TMZ the NFL legend’s defense to rape is masturbation.

We’re told Lawrence will not deny he was in the same room as the 16-year-old prostitute, but his lawyer will argue Lawrence did not have sexual intercourse — an element of third degree rape.

As one source put it, Lawrence engaged in a “masturbatory act” and that was it.

According to New York law,

“A person is guilty of rape in the third degree when … he or she engages in sexual intercourse with another person less than seventeen years old.”

Interestingly … in the criminal complaint against the alleged pimp, authorities allege Taylor engaged in “sex acts” but there is not mention of sexual intercourse — a requirement for 3rd degree rape.

As TMZ first reported, a condom was found in Taylor’s hotel room, but sources say Taylor’s lawyers will argue the condom wasn’t his and he didn’t use it.

Taylor’s lawyer, Arthur Aidala, has said flatly, his client did not have sex with the girl.