After talking to the Mayor, head right and look for the third switch on the wall. Getting past the Man Under the Stairs should be easy once you figure out his 1-pause-3-pause-1 pattern. Flip the switch and wait for the Sally sound effect.
A door will open just off-screen to the left. Go through the door and make your way through the forest. The bats are fast and furious, but pretty easy to kill. Make sure to collect as many pumpkins as you can here, because you’ll really need them later.
Finally you’ll come to a clearing. As soon as the Clown With the Tear-Away Face appears, start pelting him with pumpkins. Make sure to jump to avoid his deceptively fast unicycle antics. When he gets dazed, he’ll drop one of the heads he’s juggling. Pick it up quick and throw it at him. 3 direct hits with the juggling heads will knock him out and you’ll unlock your buddy Zero.