Walkthrough: Once inside Top Hat Tower, you'll be in a large vertical area. After getting the Coins from the Question Box behind you, move forward to find a number of floating platforms over the waters just ahead. Cappy will tell you that it will be impossible to to reach the highest platform because they submerge to quickly, but then suggests throwing him on top of one of the frogs nearby. By doing so, you will actually capture the body of the frog and will gain control on the frog's action.
As the frog, you can swim fast, jump high, and not weigh much - all of which will aid you in scaling the platforms. At the top of the platforms, you will have to face more Goombas, this time as the frog. Either defeat them by jumping on them, or simply hop your way right past them. From there, swim around the pool just ahead to find another set of rings to jump through. From there, head to the back to leap above more blocks to reach even higher platforms. More Goombas will be waiting for you, so do exactly as you did before with them.
At the top platforms will be the next door to exit through. Hold the ZL Button to escape from the frog and become Mario once again. Before going through the door, open the nearby chest to earn more overall health. Once outside, a mysterious airship will loom overhead. You can explore the outside of Top Hat Tower to gain more Coins if you'd like, or you can simply look around the sides to find the path that will lead you up to the ship. It is there that your first real battle will commence.