Deuteronomy 30:4
3 the Lord your God will reverse your captivity and have pity on you. He will turn and gather you from all the peoples among whom he has scattered you. 4 Even if your exiles are in the most distant land, from there the Lord your God will gather you and bring you back. 5 Then he will bring you to the land your ancestors possessed and you also will possess it; he will do better for you and multiply you more than he did your ancestors. 6 The Lord your God will also cleanse your heart, and the hearts of your descendants so that you may love him with all your mind and being and so that you may live.
Mark 13:27
24 “But in those days, after that suffering, the sun will be darkened and the moon will not give its light; 25 the stars will be falling from heaven, and the powers in the heavens will be shaken. 26 Then everyone will see the Son of Man arriving in the clouds with great power and glory. 27 Then he will send angels and they will gather his elect from the four winds, from the ends of the earth to the ends of heaven. 28 “Learn this parable from the fig tree: Whenever its branch becomes tender and puts out its leaves, you know that summer is near. 29 So also you, when you see these things happening, know that he is near, right at the door. 30 I tell you the truth, this generation will not pass away until all these things take place.
Notes and References
"... Scholars commonly attribute the “gathering from the four winds and from the corners of the earth/heaven” either to Zechariah 2:10, or a combination of it with Deuteronomy 30:4. As others have argued, Zechariah 2:10 should be considered a prominent allusion in Mark 13:27, for it contains all the ideas conveyed in Mark, yet with more lexical and thematic parallels than other potential sources. A comparison of the pertinent material will serve well ..."
Sloan, Paul Mark 13 and the Return of the Shepherd: The Narrative Logic of Zechariah in Mark (p. 201) T&T Clark, 2019