All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
The prayer was enjoined on the Prophet in the heavens on the night of Mi'raaj (Ascension), and he did not take it from Zoroastrianism. The Prophet was illiterate, and he was not a traveler so that he would know the cultures or matters of other nations at his time or before his time.
If, by any chance, there is something in the false religions that conforms to what Islam came with, then this does not mean that Islam took it from them; rather, this means that it is those false religions which copied it from the heavenly messages that preceded them.
The message of Islam which was brought by our Prophet Muhammad is an extension of the message of Islam brought by the previous Prophets and Messengers before him, although their legislations may be different; Allah says (what means): {Say (O Muhammad): I am not a new thing among the Messengers…} [Quran 46:9]
Ibn Katheer said, “It means: I am not the first Messenger who ever came to the world. Rather, Messengers came before me. Therefore, I am not an unprecedented incident that should cause you all to reject me and doubt my being sent to you.”
The one who studies certain beliefs and acts of worship in Zoroastrianism will definitely find out that they took them from some of the previous divine Messages. It is Zoroastrianism which took from what the Prophets and Messengers had brought. Zoroaster himself, who founded that false religion, was known before founding it to travel around and study the ancient beliefs of people, then he founded that religion.
The Arabic International Encyclopedia reads about him, “He was an Iranian (Persian or Parsi as he was also known) who was born in about 628 BC in Azerbaijan and emigrated to Bachter. After a period of traveling around and a life of contemplation in the old beliefs of the people – as the followers of this religion claim – a book called Avesta was revealed to him…”
Among the beliefs that he excerpted [from other revelations], for example, is the existence of the afterlife in which people will be resurrected to be taken to account and that they would pass over a river of fire.
The Arabic International Encyclopedia reads about the beliefs of this religion, “Zoroastrians also believe in life after death, where the spirits will unite with the bodies and the people will be resurrected for account. They also claim that everyone is going to cross a river of fire; the wicked will perish in it, and evil will end from existence...”
There is no doubt that the origin of this came in previous divine Messages, although it arrived in a distorted way to Zoroastrianism, or it is that they distorted it.
The Arabic International Encyclopedia also reads about Zoroastrianism, “Zoroaster ordered his followers to pray in front of the fire ... They pray five times a day: at sunrise, at noon, at sunset, at midnight and at dawn. They pray standing ... before the prayer they purify themselves; purification is a weapon against evil for them, because it is a source of contamination...”
The origin of prayer and purity is something that came in the previous legislations of the Prophets and Messengers; it is likely that Zoroaster took those beliefs or acts of worship from the remains of the religion of Ibraaheem (Abraham), may Allah exalt his mention.
Ibraaheem, may Allah exalt his mention, was the father of the Prophets, and most historians estimate that he lived between 1700 to 2000 BC, which means before Zoroaster by more than 1000 years.
The prayer and purification existed in the legislation of Ibraaheem, may Allah exalt his mention. Abu Hurayrah, may Allah be pleased with him, narrated that the Prophet said in the story of Ibraaheem:
“Ibraaheem entered a village where there was a king or a tyrant. (The king) was told that Ibraaheem had entered (the village) accompanied by a woman who was one of the most charming women. So the king sent for Ibraaheem and asked, ‘Who is this lady accompanying you?’ Ibraaheem replied, ‘She is my sister (i.e. in religion).’ Then Ibraaheem returned to her and said, ‘Do not contradict my statement, for I have informed them that you are my sister. By Allah, there are no true believers on this land except you and I.’ Then Ibraaheem sent her to the king. When the king got to her, she got up and performed ablution, prayed and said, ‘O Allah! If I have believed in You and Your Prophet and have saved my private parts from everybody except my husband, then please do not let this pagan overpower me...’” [Ahmad, al-Bukhaari and Muslim]
The wording of the story in Muslim is as follows:
“....and Ibraaheem (peace be upon him) stood in prayer. When she visited him (the tyrant king), he could not help but stretch his hand towards her and his hand was tied up. He said, ‘Supplicate to Allah so that He may release my hand and I will do no harm to you...’”
This story proves that the prayer and purification existed in the legislation of Ibraaheem (Abraham). So if some of this is found in a false religion, then it means that this religion took it from the legislation of the former Prophets, such as the legislation of Ibraaheem, may Allah exalt his mention.
For more benefit, please refer to fatwa 38828.
Allah knows best.