Enter in the Ghost House as Mini Mario. Go to where you see a huge ghost next to a pipe in which you have to press a switch to turn them into red blocks. Go all the way to the right and do not get hit. Keep wall jumping until you get on a secret ledge with a door. Go in the door and jump on the red flag, then use the Warp Cannon to get to World 6.