Supergirl is bringing a guest star back just in time for the Season 5 finale. According to Brainy actor Jesse Rath, his sister Meaghan Rath will reprise her role as his female doppelganger in episode 19, which will also serve as the season finale.

"Well, in [episode] 19, my sister comes back to the show," he told CBR. "She will return to the show. So I have a handful of scenes with female Brainy, or Meaghan Rath, or whatever you want to call her. So I'm very excited to see those scenes. I always love working with my sister and I'm very grateful for her to come and do the show, so I can't wait to see those scenes."

RELATED: The CW Finalizes 2020 Arrowverse Season Finale Dates

Meaghan Rath made her Arrowverse debut in "The Bottle Episode," the tenth episode of Season 5. The episode, which picked up right after the events of "Crisis on Infinite Earths," dealt with the fallout from the universe-altering crossover event. As a result of the multiverse merging into Earth-Prime, remnants of the destroyed Earths began to show up in National City -- including a few of Brainy's doppelgangers. Rath appeared one of these, while her brother Jesse played the rest.

At the end of the episode, Meaghan Rath's Brainy gave her doppelganger some advice that kicked off his major Season 5 story arc. She told him that, in order to save the world, he should work with Lex Luthor. "I fought against Lex Luthor, and it led to catastrophe beyond imagining. It endangered the entire world," she told him. "If you're going to save your world, you have to work with Lex Luthor... you must do this alone. No one can know that you're doing this. You must give up everyone and everything that you hold dear till the world has been saved."

RELATED: Supergirl's Benoist Discusses The Subtext In Lena Luthor Scene

As a result, Jesse Rath's Brainy broke up with Nia Nal, aka Dreamer, and distanced himself from the Super Friends. He agreed to become Lex Luthor's second-in-command and has acted as a double agent ever since. However, that storyline is about to come to a head.

"I think their patience with each other is wearing thin for both of them," Rath teased. "I think Brainy can't he can't really take it anymore. You know, knowing that Lex is actively manipulating him is a very frustrating thing for Brainy. You see in Episode 18, he pulls the trigger on a decision and things start to crumble around him. He's aware that Lex is manipulating him and that, I think, is part of the whole reason why he's forced to work with Lex. It's working against all of his instincts that would put him opposite Lex, and so working with him, it's not the easiest thing in the world to do. I think you see, in these next two episodes, how that all unfolds."

RELATED: Supergirl: How Jason Mewes' Surprise Cameo Came To Be

With Meaghan Rath's Brainy returning, Earth-Prime Brainy may see himself in some dire straits. Hopefully, she will have some words of wisdom to send him down the path that stops Lex from whatever he's about to do.

Airing Sundays at 9 p.m. ET/PT on The CW, Supergirl stars Melissa Benoist as Kara Danvers, David Harewood as Martian Manhunter and Chyler Leigh as Alex Danvers. The Season 5 finale will air May 17.

KEEP READING: Supergirl Reveals Who Really Killed Jeremiah Danvers