Post History
You needn't reveal that the character has the ability, but you need to reveal the fact that the ability exists. Otherwise, indeed, this is a Deus ex Machina. How you reveal the existence of the ab...
Answer
#4: Attribution notice removed
Source: https://writers.stackexchange.com/a/47029 License name: CC BY-SA 3.0 License URL: https://creativecommons.org/licenses/by-sa/3.0/
#3: Attribution notice added
Source: https://writers.stackexchange.com/a/47029 License name: CC BY-SA 3.0 License URL: https://creativecommons.org/licenses/by-sa/3.0/
#2: Initial revision
You needn't reveal that the character has the ability, but you need to reveal the fact that the ability exists. Otherwise, indeed, this is a Deus ex Machina. How you reveal the existence of the ability is up to you. Maybe someone recounts a legend. Maybe it's part of a history lesson. Maybe it is even specifically mentioned to "no longer exist" or maybe you even explain why it's extremely rare and couldn't possibly happen within the story. You could mention the thing once in passing, or you can mention it multiple times as part of your worldbuilding. Look at some examples: in _Game of Thrones_, G.R.R. Martin says multiple times that dragons no longer exist, and the eggs Daenerys holds have long turned to stone. By the end of the book, the dragons hatch. In Susanna Clarke's _Jonathan Strange & Mr. Norrel_, the Raven King is subject of old legend. Then he shows up.