From the Super Mario Wiki, the Mario encyclopedia
Mario can find the lighthouse keeper colorless at the top of the lighthouse. When Mario paints him, he becomes depressed due to the light in the lighthouse being missing. Huey tells the lighthouse keeper that he and Mario can help fix the light. The lighthouse keeper tries to help Mario in turn by teaching him about the parallel world, but Huey tells him that they already know about the parallel world. He then leaves the lighthouse and tells Mario to meet him at the entrance of the parallel world.
When Mario meets up with the lighthouse keeper, he tells the Toads that guard the parallel world to let Mario pass through. The lighthouse keeper thanks Mario again and wishes him luck, and then returns to the lighthouse, where he waits until Mario finds the Lightbulb.
When Mario brings the Lightbulb to the lighthouse, the lighthouse keeper becomes happy again and begins dancing.