This is no different to now, it was only in 2007 that Mahmoud Ahmadinejad claimed there were no gays in Iran. In various nations you can survey the populace and find wildly varying amounts of homosexuality, all correlating closely with LGBT acceptance. Even now I have muslim friends who are gay and openly tell me that they intend on suppressing their desires for their entire life so as to provide a family and not disappoint their parents.
Would your answer to the original question then be that the "sense of identity" is the result of or predominately from nurture? That is, one who sees as "gay" or "straight" sees themselves as such because of culture? Or to put it in a more generic manner, culture determines identity?
Some of the most common observations by our very small trans elderly is that they "found a way to describe" or "finally found the words" for who they are, ie the identity was always there but no terms to identify with.
I think by and large it's nature (fraternal birth order effect, twin studies etc) modulated to the extreme by societal rejection. You dont see gay men in the streets of countries where homosexuality earns the death penalty, you instead see extremely depressed "straight" men :)