“But I say unto you, That whosoever looketh on a woman to lust after her hath committed adultery with her already in his heart.” Matthew 5:28
If you are tempted but do not give into it, either by action or dwelling on this temptation in your thoughts, that is to your credit.
God knows exactly how hard things are for sinful human beginnings, and that is why we have Calvary.
These feelings become sinful, though, when they become disordered, meaning when we engage in them outside the proper context. The proper context for sexual expression is within marriage.
https://reapteam.org/lust-sin-and-why-do-bad-things-happen/
We may have Aquinas to thank for it, but un-acted-upon thoughts seem to be sinful.