In the past, Rumpelstiltskin's conman father takes a magic bean and transports them to Neverland, the place he dreamed of as a child. But he is disappointed to find that now that he's an adult he can't access any of the land's magic.
The shadow makes him a deal. Leave his son behind and he can stay and regain his youth. He gives Rumpelstiltskin to the shadow and is turned into a boy again. He chooses the name from the doll her gave to Rumpel. it's Peter Pan.
On present day Neverland, Rumpel comes face to face with Peter, his father and tries to put him in Pandora's box but Pan turns the tables and sends Rumpel into the box. Then Pan tells Henry that he must give him his heart in order to save magic. Henry thinks he'll have to stay in Neverland but Pan doesn't tell him he will die in order for Pan to be immortal.
Emma, Neal and Regina try to convince Henry that Pan is lying but he doesn't believe them. He give Pan his heart and falls unconscious as Peter Pan rises above them all.