Note the comments of Ellicott on Matt 2:1:
Wise men from the east.—The Greek word is Magi. That name appears
in Jeremiah 39:3; Jeremiah 39:13, in the name Rab-Mag, “The chief of
the Magi.” Herodotus speaks of them as a priestly caste of the Medes,
known as interpreters of dreams (I. 101, 120). Among the Greeks the
word was commonly applied with a tone of scorn to the impostors who
claimed supernatural knowledge, and magic was in fact the art of the
Magi, and so the word was commonly used throughout the Roman world
when the New Testament was written, Simon Magus is Simon the sorcerer.
There was however, as side by side with this, a recognition of the
higher ideas of which the word was capable, and we can hardly think
that the writer of the Gospel would have used it in its lower sense.
With him, as with Plato, the Magi were thought of as observers of the
heavens, students of the secrets of Nature. Where they came from we
cannot tell. The name was too widely spread at this time to lead us to
look with certainty to its original home in Persia, and that country
was to the North rather than the East of Palestine. The watching of
the heavens implied in the narrative belonged to Chaldea rather than
Persia.
That the word μάγοι is Persian, does not prevent it being applied to Chaldean learned philosophers/astronomers as well. Thus, we do not know from whence these magi came except the brief statement "from the east".
In any case, Daniel's influence in both the Babylonian court (Dan 2, 4) and the Persian court (Dan 1:21, Dan 6, Dan 1:1) made him both admired and reviled (Dan 6:4, 5, 25-28). Daniel's writings included a great prophecy of Messiah (Dan 9:24-27) that was known to the learned of the east.
Based on Matt 2:1, some of those in the East appeared better prepared to receive the Messiah than the Jewish leadership. In Matt 2:2 the Magi also appear to allude to the prophecy of Balaam (an Aramean prophet) in Num 24:17 - "I see him, but not now; I behold him, but not near. A star will come forth from Jacob, and a scepter will arise from Israel. ..."
Thus, there was opportunity for these Magi (whoever they were) to know about the coming Messiah.
APPENDIX
If the Magi were Persian, then Jesus would have been born during the time of Phraates IV (37–2 BC) king of the Parthian Empire.