The former child star, 38, who has been engaged to Linda Perry since earlier this year, spoke about her sexuality on Thursday during The Talk's "secret" week.
"I want people to know there can still be a struggle with it and that's okay," says the show's co-host. "It's a process and there can be a part of you that doesn't want to feel different or feel scared."
Gilbert credits ex-boyfriend Johnny Galecki, 38, for helping her through the experience of coming to terms with her sexuality.
"I thought he was super cute and I had a total crush on him," Gilbert recalls of her former Roseanne costar. "And we started dating and he would come over and we would, like, make out, and then I would start to get depressed."
Once Gilbert realized Galecki was offended by her actions, she "eventually told him I thought it was about my sexuality and he was super sweet about it."
"I started dating a woman who was like 18 years older than I was, who was also in the public eye," she continues. "It was something people could have found out about. Like no one knew at the show for years, and Johnny held the secret the whole time. And I always felt so scared. If it came out, what could happen? Could I lose my career? Will I ever be able to play a straight role again?"
All these years later, Gilbert, who has appeared on Galecki's The Big Bang Theory, is still close to her ex, who she spoke to before Thursday's emotional reveal.
"I called him and I just said, 'Is it okay – I'm thinking of talking about this,' " Gilbert said, adding with a laugh, "The story sort of starts with you. And I've got to say I made out with you and got depressed, which is kind of a bummer."
She adds: "[He said], 'Of course. I love you and I think it's really important and I'm so proud of you … If you want, I will be there and I will hold your hand.' It was so sweet, and this story really makes Johnny look good."