Gudmundsson had given the visitors an early lead but Stephan Lichtsteiner scored twice along with Fabian Schar and a Blerim Dzemaili penalty as the hosts went 4-1 up with less than an hour played. However, Kolbeinn Sigthorsson pulled one back before Gudmundsson struck twice to complete an unlikely comeback.
Switzerland still hold a four-point lead at the top of the group over Norway but coach Ottmar Hitzfeld will not be impressed by the way his side squandered a probable victory.
It was Iceland who made an ideal start by shocking their hosts with a third-minute lead. Gylfi Sigurdsson's cross from the left found Gudmundsson in the centre of the penalty area and he fired a left-footed shot into the top right-hand corner.
That, though, served only to wake the hosts from their slumber. Xherdan Shaqiri and Schar both unleashed efforts before Switzerland equalised in the 14th minute, Lichtsteiner slotting home into the bottom right-hand corner.
Swiss control early on
Hitzfeld's side then took the lead 13 minutes later when Haris Seferovic's shot was blocked by Ragnar Sigurdsson only for Schar to pounce on shoot home from close range. And Switzerland were on target again just three minutes later when Shaqiri's pass from the right found Lichtsteiner who then sent the ball into the bottom left corner.
Haris Seferovic had a number of shots which went over or were blocked and Granit Xhaka headed wide as the Swiss threatened to run rampant. The Swiss carried on where they left off after the break, Dzemaili's long-range shot hitting the wall before they extended their lead in the 54th minute from the spot. Birkir Mar Saevarsson's foul on Valentin Stocker saw a penalty awarded with Dzemaili firing home fiercely.
Sigthorsson pulled one back with a right-footed shot a minute later and the visitors reduced the deficit further 12 minutes later. Gudmundsson got his second of the night, firing home into the top left-hand corner and after at one point looking as though they could be on the wrong end of a drubbing, the visitors were now searching for an equaliser.
Aron Gunnarsson shot over from distance and Sigthorsson fired wide but it appeared that Switzerland had done just enough to hold on for victory. That was before Gudmundsson's intervention in the final minute, though, as he completed both his hat-trick and Iceland's comeback by firing into the top left-hand corner.