The episode you're thinking of is "The Vault" (Season 5, Episode 34). In this episode, Finn and Jake discover a vault filled with miniature versions of various characters—including Lady Rainicorn, Lumpy Space Princess, and Marceline the Vampire Queen. Finn gains control over these tiny figures using a remote control and uses them to help escape the vault.