Set in the 24th century , the series follow the adventures on Deep Space Nine , a space station located near a stable wormhole between the Alpha and Gamma quadrants of the Milky Way Galaxy . In this episode , Captain Benjamin Sisko ( Avery Brooks ) and the crew travel back in time to prevent the assassination of Captain James T. Kirk ( William Shatner ) of the USS Enterprise by a Klingon using a booby @-@ trapped tribble .