A most excellent question, Aziz! I don’t have the complete answer, but googling gets what seems to be most of it.
The original form, per Pharaoh, ends in a vowel. Hieroglyphics pr-3, Late Egyptian par-ʕoʔ, Greek pharaō /pʰaraɔ́ː/, Hebrew פרעה (parʿōh), Latin pharaō.
The Greek word pharaō is indeclinable, but it does have a variant that is declinable: pharaōn, pharaōn-os. The Latin word regularly inflects as pharaō, pharaōn-is. That inflection explains why the –n in pharaon would show up in languages like French—just like virgo, virginis ends up as virgin, and origo, originis ends up as origin.
If anything, it’s a surprise that pharaoh does not end up as pharaon in English. It’s almost like someone respelled the word to match the Hebrew better. And of course, that’s exactly what happened, with the King James Bible changing the traditional renderings of Biblical names based on the original languages. The Middle English spellings of the word were Pharao (Latin) and Pharaon (French).
That’s explained the European languages that have the –n, and that learned of the Pharaoh via the Latin Vulgate. But how did it get to Arabic Firaun?
I don’t know, but Christoph Heger in this Usenet thread (Google Groups) does. Think about it. How did Arabs hear about Pharaoh? Either directly from Jews, or from Christians. What language did the Jews and Christians speak that they were likely to hear about Pharaoh from?
Give up?
There is no need of Divine revelation to get the “n”. In the (pre-Christian) Greek translation of the Hebrew Scriptures (the so called Septuaginta) the Hebrew “Par`oh” – also pronounced “Far`oh” – in the nominative case was written “Pharao”. The regular Greek declension of such a word like “Pharao” is “Pharaonos”, “Pharaoni” and “Pharaona” in the genetive, dative and accusative, resp. Especially the plural is “Pharaones”. One says the “stem” of the word is “Pharaon”.
The latter version entrenched the Syriac (Aramaic) language, in which the Egyptian ruler is termed “fir`own”. Therefore it is not correct to say that Jews and Christians always said “Pharaoh”. Aramaic speaking Jews and Christians said “fir`own”. And this word again entrenched the Arabic language, as many other Aramaic words did, giving rise to words like Allah, Qur’an, ayah, salat, zakat etc.
In other words, the –n got into Aramaic through a similar mechanism to how it got into French: by using the stem consonant as the ending in the borrowed form. Once it was in Aramaic, it got to Arabic. Once it got to Arabic, it got to all Islam-influenced languages.