You don't have to leave Islam to leave the community. You can have a relationship with God without following every rule that your community insists on.
Personal experience, I was surrounded by some very conservative Christians growing up. I was told that in order to be Christian, in order to believe in God at all, I had to follow their rules about my life. I was told that any attempt to think for myself was a waste, because ~obviously~ the local church knew better. Then, I started to research religion. I found sects of Christianity that held entirely different values than those I'd been raised with, and I actually found a lot of wisdom from Jewish folks that really resonated with me. I'm not a Christian at the moment, but I was able to choose that for myself, after exploring all the different ways to be Christian, and to be religious in general. Even then, I still believe in and pray to God. I didn't have to give that up, just because I started to explore the possibilities.
I would encourage you to seek out Muslims outside of your community. Some blogs I've found that talk about being Muslim and being queer are hijabi-frog, russianmuslimlesbian and queer-muslim-culture-is.