Actually Christ said if you have thought it then you have done it. Which is why we will never be able to keep the law. Also we have the issue of original sin. So is the five year old a sinner because he thinks he is a girl? I would say biblically no, yet he has the sin of Adam so he is a sinner. I agree what we are talking about here is acting on a sexua| impulse.
Sexual stuff is always a big issue in scripture. Even when dealing with the gentiles in acts 15 starting in verse 22 it speaks of what is required of the gentiles in regard to the law. Basically (28-29)it is stay away from blood and pagan sacrificial leftovers and abstain from sexua| immorality. That was it, no law of Moses, no circumcision, no sabbath etc. But sexua| sin always comes up.