The older Zeldas, if they even fit into order at all, happen after WW, therefore, how did Gannondorf break out? Um... he didn't. Yah sure, you beat him in Windwaker and all, but the Zelda series has a habit for doing this kind of thing, what kind of thing? Giving Gannon a shade or temporary form. "Gannondorf" from Windwaker is most likely just a shade or part of the true Gannon. Most likely "Gannondorf", now just a part of the real Gannon, was working to release Gannon from his prison, which would make sense on what exactly he was after.
I could be wrong, who will ever know?