Torres will guest star on Castle as a "successful fashion mogul" named Samantha Foster, who is part of a reality show, reports TVLine.
When the cameras aren't rolling, Foster "may be even more devious" than how she is on the reality show.
Torres will reunite with her Firefly co-star Nathan Fillion, who plays the title character on the ABC show.
Castle will premiere its fifth season on January 7, 2013. Torres will make her Castle debut in February.
Torres is also known for her role in the Matrix franchise, as well as television shows such as Huge and Suits.
Watch a trailer for Suits below: