This is a question which is raised so very often in all of its variations "Would the Holy Fire be there if the patriarch were outside the Church?" "Elder so-and-so performed such and such a miracle," "Saint Somesergianistguy prophesied this and that to me so many years ago," and even extending outside of what calls itself Orthodoxy, to various heretical confessions.
Because of its frequency I have decided to leave a statement from the Apostolic Constitutions here as a general reminder for myself and others:
We add, in the next place, that neither is every one that prophesies holy, nor every one that casts out devils religious: for even Balaam the son of Beor the prophet did prophesy, though he was himself ungodly; as also did Caiaphas, the falsely-named high priest. Nay, the devil foretells many things, and the demons, about Him; and yet for all that, there is not a spark of piety in them: for they are oppressed with ignorance, by reason of their voluntary wickedness. It is manifest, therefore, that the ungodly, although they prophesy, do not by their prophesying cover their own impiety; nor will those who cast out demons be sanctified by the demons being made subject to them: for they only mock one another, as they do who play childish tricks for mirth, and destroy those who give heed to them. For neither is a wicked king any longer a king, but a tyrant; nor is a bishop oppressed with ignorance or an evil disposition a bishop, but falsely so called, being not one sent out by God, but by men, as Ananiah and Samœah in Jerusalem, and Zedekiah and Achiah the false prophets in Babylon. And indeed Balaam the prophet, when he had corrupted Israel by Baal-peor, suffered punishment; and Caiaphas at last was his own murderer; and the sons of Sceva, endeavouring to cast out demons, were wounded by them, and fled away in an unseemly manner; and the kings of Israel and of Judah, when they became impious, suffered all sorts of punishments. It is therefore evident how bishops and presbyters, also falsely so called, will not escape the judgment of God.
From Book 8 of the Apostolic Constitutions, which you can find in the 19th C. Ante-Nicene Fathers translation by Donaldson (available online here).