When did the word "sex" enter the English lexicon as a way to say intercourse?

by Vladith

I don't believe I've ever seen it on film or print earlier than a pre-Hays Code movie.

Galerant

According to the Online Etymology Dictionary, the earliest known reference to "sex" as in "intercourse" is in the writings of D.H. Lawrence in 1929, so you're right in that it's a relatively recent sense of the term etymologically-speaking.