The animals of the Central Park Zoo all get ready for the Zoo to open in the morning. As the Zoo opens, visitors are introduced to Marty the Zebra, Gloria the Hippo, Melman the Giraffe, Alex the Lion and Skipper, Private, Rico, and Kowalski (the Penguins) (“It’s Showtime”). The penguins assemble, acting as if they are undercover so that they can escape to Antarctica (“Penguin Underscore No. 1”). They bump into Marty the Zebra, who learns their plans and starts to daydream about what it would be like to live in the wild (“Wild and Free”). Alex the Lion surprises Marty for his tenth birthday. Gloria, Melman and Mason the Chimp enter with a cake and they celebrate. The crowd inquires about Marty's wish when he blew out the candles. He confesses that he wished he could go to the wild. All of Marty’s friends react poorly.
After the party, Alex goes to see why Marty is upset. Marty tries to convince Alex to travel into the wild with him. Alex refuses but exclaims that he is there for him if he needs anything (“Best Friends”). Marty decides to leave without Alex.
The streets of New York are bustling as Candy Hammernose, a reporter, announces that there has been a zebra seen roaming Manhattan. Halfway through her report, she announces breaking news that a hippo, a giraffe and a lion are also on the loose (“News Underscore”). Gloria, Alex and Melman discuss their shock at Marty’s escape from the zoo as they look for him. Marty runs into the penguins, which he mistakes for nuns (“Penguin Underscore No. 2”). Gloria, Melman and Alex spot Marty and quickly make their way over. The penguins switch directions to escape. The Police and Animal Control seize Marty and his friends as they attempt to stay calm (“Relax, Be Cool, Chill Out”). As they feel the effects of the tranquilizer that Animal Control used, everything turns to slow motion (“Grand Central”).
The animals then find themselves on a ship in separate crates. The penguins escape their crate and take out the captain to gain control of the ship (“Penguin Underscore No. 3”). The penguins attempt to steer the ship as the animals slide back and forth in their crates (“Southward Ho!”) The penguins sing as they try to steer towards Antarctica (“Penguins’ Sea Shanty”).
Alex, Melman, Gloria and Marty all find themselves on the beach of a beautiful island. They discuss to which zoo they think they have been transferred. They rejoice in the fact they are all alive and together, but Alex is mad at Marty for making them leave their home. They then meet Mort, a tiny lemur, followed by Lynn and Lars Lemur, who are panicking about "The Foosa" following them. Alex unintentionally scares the Foosa Leader when he tries to find zoo officials, saving the lemurs. The lemurs insist that they follow them to meet their king, King Julien the Thirteenth. The lemur king’s advisor, Maurice, joins them and welcomes them to Madagascar. King Julien then arrives and introduces himself (“Welcome to Me”), following that with a song about his passion for having a good time (“I Like to Move It”).
King Julien thanks them for scaring away the foosa, which they explain is a catlike, carnivorous animal that is native to Madagascar. King Julien creates the plan to befriend the animals so that Alex will protect the lemurs from the foosa. Alex gets more and more impatient to go home. The lemurs invite the animals to stay with them for the night. Because of his hunger, Alex dreams of the food that he was fed at the Central Park Zoo (“Steak”) and accidentally ends up licking his lips and staring at Marty. Maurice the lemur expresses apprehension to King Julien about his plan to befriend Alex.
The penguins are found, still on the ship but clearly freezing and miserable as they make their way up north. They make it there and quickly turn around to head back south (“Sea Shanty – Reprise”).
Gloria, Melman, Alex and Marty wake up to find that King Julien and the Lemurs have moved them to a beautiful watering hole. Marty is overjoyed. Gloria and Melman quickly get excited, but Alex is miserable because he is so hungry (“Living in Paradise”). Alex bites Marty’s behind while he is dreaming of steaks. His friends become scared of him. Alex runs off so that he can’t hurt his friends. The animals then hear a ship's horn, and Marty rushes off to the unsafe side of the island to find Alex (“Ship's Horn”).
Gloria and Melman come up to the boat. They discover that the penguins had been steering it and sent the people on a lifeboat to China (“Penguin Underscore No. 4”). Gloria and Melman then realize that Marty followed Alex and decide to go after him.
The foosa enter and are looking for food (“Foosa Hungry”). Marty finds Alex, but Alex refuses to go with him because he doesn’t want to hurt his best friend (“Thunder”). Marty expresses that he won’t leave because they are best friends... just as the Foosa leader starts to approach Marty (“Best Friends – Reprise”). Alex pretends that he is still a predator so that they can escape the Foosa. Alex, Melman, Gloria and the Penguins also arrive. They face off, and the animals from New York are victorious. Alex declares himself the king of Madagascar (“The King of Madagascar”). They all celebrate with a beach party (“Together Forever”).