So claims Rabbi Aryeh Kaplan in his Handbook of Jewish Thought Part Two p. 367 (24:21) from the verse of “נביא מקרבך מאחיך”.
The relevant excerpt (courtesy of Aish.com):
There is another important reason why the ingathering of the exile must precede the coming of the Messiah. One of our traditions regarding the advent of the Messianic Era is that it will mark the return of prophecy among the Jewish people. Furthermore, according to the final words ever spoken by a prophet, Elijah will return as a prophet and announce the coming of the Messiah, as it is written, “Behold I will send you Elijah the prophet before the coming of the great and awesome day of God” (Malachi 3:23). This is necessary because the Messiah will be a king, and a king can be anointed only by a prophet. Besides this, the Messiah himself will be a prophet, the greatest of them all, second only to Moses.
Thus, the restoration of prophecy is very important in the unfolding of the Messianic drama. This, however, requires a number of conditions. First of all, prophecy can usually take place only in the Land of Israel, and not in any other land. The Land of Israel, however, is not conducive to prophecy at all times. Before prophecy can exist in the Land of Israel, it must be inhabited by the majority of Jews in the world. Thus, unless we assume that this rule is to be broken, more than half of the Jewish people will have to live in the Land of Israel before the Messianic Era commences.
I failed to track down the source in Chazal by the references but didn’t work too hard. (Yoma 9b אם עשיתם עצמכם כחומה ועליתם כולכם בימי עזרא נמשלתם ככסף שאין רקב שולט בו is not a perfect proof.)