"The Outcast" was the 17th episode of the 5th season. It features an androgynous race of people who ask for the help of the Federation when two crewman on a shuttlecraft get lost in their atmosphere while exploring a null in space.
Riker volunteers to take a shuttle to look for the missing along with a Janii named Soren. It is the times they spend on the shuttlecraft where a relationship develops between Riker and Soren. Soren reveals to Riker that she identifies herself as female and has longings for him.
According to Wikipedia, "this episode was intended to address the contemporary issue of LGBT rights." I think it fails as a Star Trek episode, not so much for the plot itself, but that Commander Riker falls in love with the character of Soren and runs the risk of ruining his career for this androgynous person. In the past, he left Troi to pursue his career! It seemed out of character for him to put love for anyone above his career in Starfleet. And this love affair could jeopardize not only his career but violate the prime directive.
Also, the subplot, which was weak, seemed more of a fill in for the main story. Why would Riker volunteer for such an assignment rather than a regular helmsmen? (Yes, I know...almost every episode has this idea of putting a senior staff at risk).
The show's only redeeming part was Soren's speech to the council of Jnaii (after her love for Riker is found out) where she chastises her society for treating those who are different as outcasts and forcing "therapy" on them.
She is then taken away to undergo treatment for her "sickness." Riker, with the help of Worf, beams back down to the planet to get Soren and offer her asylum on the Enterprise, but too late. She tells Riker she's sorry and why would she want to go with him when she's no longer "sick." The "therapy" worked, which is opposite the reality of today's conversion therapy in which Christian therapists attempt to "heal" homosexuals.