The clue on the wall says
"Beyond, beyond, beyond...
Complete All Seven...
Before, before..."
And when I talk to Goombella she says "beyond" refers away from the door (i.e. the left block), and "before" means the right block.
I figured "complete all seven" must mean I had to get the other seven keys first, but it still didn't work. Then I tried putting the keys into the locks on the top floor, and it still didn't work.
This is driving me crazy.