When Castle first hears that the crime scene is the Nebula-9 ship, he starts bashing the show and says "I'm a fan of good sci-fi. Star Trek, Battlestar, that Joss Whedon show!" 'That Joss Whedon show' was Firefly where Nathan Fillion played Captain Malcolm 'Mal' Reynolds.
The closing musical theme is sung by William Shatner, who played Captain Kirk in the original Star Trek series.
Castle states that Nebula 9 was not a real science fiction show because it only aired 12 episodes. Firefly (2002), starring Nathan Fillion, only had 14 hour-long episodes (including the 2-part pilot), plus one that was never even aired. Hence, 12 aired episodes.
Benjamin Donnelly the SciFi tech dealer was played by Armin Shimerman, who can also be found playing Quark, the Ferengi bar tender/black market dealer, on Star Trek DS9. Shimerman also played Principal Snyder in the TV series Buffy the Vampire Slayer (1997) for the first 3 seasons. As it is already known, many characters from Buffy and Firefly have been known to make appearances on Castle as well.
Jonathan Frakes: The fan who received Castle's autograph, better known as Commander William T. Riker of Star Trek: The Next Generation (1987). He calls himself Castle's "number one fan" and on ST:TNG, Frakes was often called "Number One."