While traveling in the Delphi sector in the 2260s, the Shinobi was captured by the omnipotent being known as Trelane. Trelane placed the ship inside a glass bottle, and took the crew of the Shinobi and forced them to participate in a simulation of World War I era Germany. This included Captain Gernsbeck, who was forced to play the role of the local bartender Gretel who was also employed by the French as a spy.
When the USS Enterprise was captured by Trelane, Captain James T. Kirk, Commander Spock, Doctor Leonard McCoy, and Lieutenant Commander Walter Ellis were able to secure the release of the Shinobi, Enterprise, and the other vessels Trelane had captured. Captain Gernsbeck boarded the Enterprise to thank Captain Kirk for rescuing them, and because of the simulation found Captain Kirk somewhat familiar, despite the fact that she had no memory of her time in Trelane's simulation. (TOS video game: Judgment Rites)