Near the end of the level, where the "Return Home" portal is, there's a locked chest. The key to the chest is accessible by gliding to a platform after the first whirlwind. I recommend looking up a walkthrough as explaining it via text might be difficult. You should have picked up the key by the time you get to the Doctor Shemp boss itself.