Sanhedrin 75a:2, ca. 450-550 CE
[Apropos the discussion of the obligation to allow oneself to be killed rather than engage in forbidden sexual intercourse, the Gemara notes] … that Rav Yehuda says that Rav says: There was an incident involving a certain man who set his eyes upon a certain woman and passion rose in his heart, to the point that he became deathly ill. And they came and asked doctors what was to be done with him. And the doctors said: He will have no cure until she engages in sexual intercourse with him. The Sages said: Let him die, and she may not engage in sexual intercourse with him. The doctors said: She should at least stand naked before him. The Sages said: Let him die, and she may not stand naked before him. The doctors suggested: The woman should at least converse with him behind a fence in a secluded area, so that he should derive a small amount of pleasure from the encounter. The Sages insisted: Let him die, and she may not converse with him behind a fence.
[The William Davidson Talmud, via sefaria.org]