A lot can be found in Zecharya, chapter 14. Especially in the beginning. In posuk 16, it writes:
All who survive of all those nations that came up against Jerusalem
shall make a pilgrimage year by year to bow low to the Supreme G-d of
Hosts and to observe the Feast of Booths.
See also the commentary of the Abarbanel (ad loc.) and the Mashmiah Yeshua (ad loc.).
HaRav Moshe Lichtenstein wrote an detailled article explaining the connection between the Haftara of Shabbos Chol HaMoed and Sukkos. He writes:
In light of this, let us go back and discuss the connection between the haftara and the festival of Sukkot. Just as the deliverance of Israel in the war to be fought in the end of days is presented in the two prophecies from two different perspectives, so too the sukka can be understood as protecting Israel from two different perspectives. On the one hand, the sukka provides an answer to the human problem of a person in need of protection and shelter from heat, cold, and rain. It provides shade and cover to one who needs them, and in this way it protects the person in need of protection. From the time of the exodus at the beginning of Jewish history and until the war to be fought in the end of days, G-d spreads His protection over His people and shields them by way of the sukka. "For in the day of evil He shall hide me in His sukka; in the covert of His tent He shall hide me" (Tehillim 27:5). Man is in need of protection and the sukka given to him by G-d provides him with the required shelter.
On the other hand, the sukka is the site of the Shekhina's presence in the world, whether as a place protected by God as His own space, like the clouds of Glory that shielded Israel by way of the Shekhina's presence within them, or by the very presence of God in this world, which finds expression in the sukka. "In Shalem also is His sukka, and His dwelling place is in Zion" (Tehillim 76:3). The Torah readings for Shabbat Chol Ha-mo’ed focus on the idea of God's appearance to man, just as the essence of the festivals lies in the idea of standing before God. For this reason, the prophecy dealing with the war to be fought against Gog and Magog, in which God will reveal Himself as He fights against the wicked, fits in well with this system and reflects another dimension of the war to be fought in the end of days that is connected to the festival of Sukkot
My understanding of this is that the reason why Sukkos is connected to Gog uMagog, is that in the "final war", G-d will give us shelter, a protection, like the clouds of glory in the midbar.
Furthermore, the Shulchan Aruch (Orach Chaim, siman 625:1. See also the Tur, ad loc.) explains the deeper meaning behind this shelter of the sukkah.
On Succot we shall dwell for 7 days etc. Because on Succot I protected the children of Israel.
Another reason why Sukkos is connected with Gog uMagog, might be because both will fall in the month of Tishrei, as the Alter Rebbe writes in his Shulchan Aruch HaRav (490:16):
When Shabbos falls during Chol HaMoed Pesach, [Yechezkel’s vision of] the dried bones should be read as the Haftarah. On the Shabbos of Chol HaMoed Sukkos, [the prophecy of] the war of Gog and Magog should be read as the Haftarah. [These readings were chosen] because the Resurrection of the Dead will take place in Nissan and the war of Gog and Magog will take place in Tishrei.
Refer also to the sefer "Zeman Simchateinu" (Maamar 2, p. 28):.
וכיון דנתבאר בדברי הגר"א שהובא לעיל מאמר א אות ב רכל תוכן ענינו של חג הסוכות הוא כנגד בנין המשכן שכתב בביאורו לשיה"ש והג' הוא נגד סוכות שהוא זכר להיקף ענני כבוד שהיה תלוי בבנין המשכן כידוע' א"כ כמו שבנין המשכן הוא יום שמחת לבו של הקב"ה כיון שהוא בחינת החופה שבין הקב"ה לישראל גם המועד של סוכות שהוא כנגד בנין המשכן הוא זמן שמחתנו' ונתיחד בשמחה יתירה כמו שבנין המשכן הוא יום שמחת לבו של הקב"ה וזה באמת עצמו של יום זה שהוא זמן שמחתנו' כיון שהוא הזמן שנקבע כנגד יום שמחת לבו' של הקב"ה בהשראת השכינה במשכן ולפיכך נתיחד חג הסוכות בשמחה יתירה יותר מכל המועדים