With the help of Hoggle, Sir Didymus (with his dog Ambrocious) and Ludo, Sarah (Jennifer Connelly) is able to reach the Goblin Castle before time runs out. It's there she confronts the Goblin King (David Bowie) and defeats him by stating a phrase she learned at the beginning of the movie, in which she proclaims he has no power over her.
The scene then returns to her house, where her brother Toby (the one she wished to be taken by the goblins to begin with) is safely in his bed. She sits at the make-up mirror as her parents come home, and Didymus, Ludo, and Hoggle appear to tell her goodbye. Hoggle begins to say, "Should you need us for anything..." She explains that she needs him, all of them. Suddenly, a big party breaks out, with numerous characters reappearing to celebrate Sarah's victory. As the party continues, a curious owl peeps through the window before flying off into the moonlight.
Thanks Robert W.!