Because Mohiach ben Yosef will be anointed/assigned to war [of Gog uMagog] (as one is said to be in Rashi's comment to Dt 20:2).
That is stated in Bet Hamidrash 6:96 (seven lines from the bottom):
...אף לעתיד לבא משוח מלחמה עתיד לעמוד מיוסף, ומשוח העומד מיהודה קשה
ממנו, שנאמר (זכריה י') וגברתי את בית יהודה .
I heard an awesome answer in a Dvar Torah given at our shul awhile ago:
The idea starts from the selling of Yosef into slavery: The Yishmaelim who took part in the deal were said to be
"...a caravan of Ishmaelites coming from Gilead, their camels bearing gum, balm, and ladanum to be taken to Egypt." (Genesis 37:25)
Gilad is significant to the story as it ...