From the Super Mario Wiki
Goomboss Battle is a level in Super Mario 64 DS. It is entered through the Mario painting in Peach's Bedroom. Upon completing it, Yoshi will earn the key to unlock Mario. The entrance to the level is the Mario painting, which is behind the 8-Star Door in the Rec Room.
The level is set in a gloomy forest on a series of platforms above a field of toxic gas, which should simply be avoided. Navigating the level shouldn't be too troublesome, despite its vastness and appearance. The goal here is to find and enter Goomboss' chamber, where Yoshi must defeat him. Two Power Stars can be found in this level, both of which can only be collected on return visits. It is possible to obtain 100 coins in this level, but unlike other levels in Super Mario 64 DS, the player is not rewarded with a Power Star for doing so.
The player must find the eight Red Coins to make the Star appear. However, because the Mario, Luigi and Wario caps are needed for some of the coins, it cannot be obtained until the player has rescued them later on.
After rescuing Mario from this very level, Mario must press the Star Switch in one area of the level and use his Wall Jumping ability to scale a caged shaft where the Star will appear for a limited time.