The point of a Deus Ex Machina is that there's no setup for it. If we have two books of "This is how you get godlike power", a list of people who previously had that godlike power, a prophecy that soon someone will get that godlike power, specific criteria for who can get the godlike power and several mentions of how the previous holders of the godlike powers can't hold on to them, if then that someone gets that godlike power, that's not a Deus Ex Machina.