User blog comment:EvanDude345rv5/Fairy Tail 353 : Nine Ghost Gate/@comment-3424593-20130928223035/@comment-5580383-20131001004231

Brain was a Zeref Cultist or at least affiliated with them and Gilmore Heart as part of the Balam Alliance. Jellal killed off the  Zeref Cultists that controlled Tower of Heaven only to become one himself thanks to Ultear.

Also it was shown that Brain trained Jellal to use his magic better as seen with his flashbacks back within chapter 147, it was further elaborated within episode 60 with the connection between Jellal and Brain's relationship of him training Jellal and  Brain   using former slaves of Tower of Heaven to form the Oracion Seis.

It's possible that Jellal  at the time he was brainwashed  could've  struck a deal with Brain  by giving him the slaves   that would later become the Oracion Seis in exchange for more power as well.