Ranked 202 in the world, Somalia halted a run of 19 successive defeats stretching back eight years to secure their first qualifying win.
Anwar Sid Ali Shakunda headed home the only goal of the game in the 87th minute, in a match played in Djibouti due to the security problems in Somalia.
Zimbabwe, who played in the Africa Cup of Nations finals two months ago and are 90 places higher in the world rankings, will host Somalia for the second leg on Tuesday.
Somalia played with seven debutants among a number of new players from immigrant communities in Europe and north America.
Elsewhere on Thursday Ramadan Agab notched a hat-trick as Sudan beat Chad 3-1 away
Agab opened the scoring early in Ndjamena and extended the lead when Chad goalkeeper goalkeeper Adoum Defallah hit his goal kick straight at Agab who needed no second invitation to put the ball in the net after 67 minutes.
He completed his treble with a close-range finish six minutes later. Chad's consolation goal came from an 85th-minute penalty converted by captain Ezechiel N'Douassel.
Two goals in four minutes helped Rwanda to a comfortable 3-0 away win over the Seychelles in their first-round first-leg qualifier in Victoria.
Muhadjiri Hakizimana opened the scoring just after the half hour and Yannick Mukunzi soon doubled the lead.
Meddy Kagare made sure of the biggest winning margin of the African qualifiers so far with the third goal 10 minutes from time.
Rwanda host the return leg in Kigali on Tuesday.