Star Trek: Season 2, Episode 22
Beings from another galaxy commandeer the Enterprise in an attempt to return home.