Set in the 24th century, the series follows 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, a surprise change programmed into Vic's (James Darren) lounge by the designer, Felix (a friend of Dr. Bashir), turns the lounge into a mob-owned casino and burlesque where Vic is no longer welcome.
Julian Bashir and Miles O'Brien enjoy an evening at Vic Fontaine's in the holosuite until the program suddenly changes into a noisy cabaret and Frankie Eyes, Vic's longtime rival, shows up to throw Vic out. Bashir and O'Brien try to delete Frankie or freeze the program, but it doesn't work.
After Frankie fires Vic, the crew learns that Frankie was written into the holosuite program by Vic's designer, Felix. Upset by Frankie's treatment of Vic, and by the knowledge that the lounge's atmosphere will now change, the crew decides it must rid the program of Frankie. But to accomplish this task, they realize, he must be eliminated in a way that is period-specific to Fontaine's era: circa 1962. They cannot simply rewrite the program because that would result in Vic forgetting all the experiences that he has shared with the crew up to this point. The task takes on greater urgency when Vic is beaten up.
Vic reveals that he was assaulted by Frankie's bodyguard, Tony Cicci. Eager to discover Frankie's weak spot, Odo and Kira go undercover in the casino to do some research. Frankie takes a liking to Kira, and while the two flirt, Odo learns that Frankie works for crime boss Carl Zeemo, who expects to receive from Frankie a large skim of the hotel's huge daily profits. The crew hatches a plan to rob the casino, hoping it will cause Zeemo to "bump off" Frankie in retaliation.
The plot is set in motion when the crew infiltrates the casino staff, and Vic convinces Frankie to let him bring his high rolling contacts into the casino — who, unbeknownst to Frankie, are Starfleet officers. Meanwhile, Benjamin Sisko resents Kasidy Yates' participation in the plan, admitting he has not visited Vic's because of how blacks were treated in Las Vegas in the 1960s. She urges him to reconsider, citing as reason the comfort she and Jake have both felt in the lounge, and soon Sisko agrees to play a pivotal role as a big-money gambler.
Vic walks the crew through their complex plan, to be executed the following night before Zeemo arrives. A security guard makes a phone call at the same time each night which allows them only eight minutes to pull off the heist. Though all crew members are well-prepared for their roles, the actual evening presents several glitches to the plan — most notably when Nog discovers that the lock on the safe is of a different type than expected. While he struggles to crack the lock, Zeemo arrives a day early to pick up his cash.
Noticing Zeemo's premature entrance, Vic does his best to stall him, while the other crew members fabricate enough stories and distractions to allow a successful Nog and Odo to slip away with the cash. After Zeemo discovers an empty safe, his thugs lead Frankie and Cicci out of the casino while reaching for the guns under their lapels — leaving Vic to his cherished role as lounge singer and the crew to theirs as satisfied patrons.
The atmosphere of the lounge changes back to the way it was originally. Vic takes the stage with his own band back, and calls up Captain Sisko, who joins him in a duet of "The Best Is Yet to Come".