Captain Toad is in a library. At the top is the Star. To the left is a gear. Spin it to make part of the library rotate. You'll find the first gem in a small book case that rotates into place if you rotate the floor to the right. The next part will allow you to reach the Star, as well as go into the bookcase underneath it. To the right of the stairs is a golden mushroom. Go under the star for some coins. Spin the gear again and you'll be able to reach the second gem, below and to the right of the Star. Rotate the floor back into its original position to enter the lowest part of the bookcase. There's a purple pipe back there that will take you to the underside of the library. You'll find the Toad Brigade here. Blue Toad will give you the third gem. Return and spin the gear so you can reach the Star.
Special Challenge: Collect the Gold Mushroom.