Seferovic’s winner capped a remarkable comeback by the top seeds in the group as fellow substitute Admer Mehmidi had taken just 121 seconds to make his mark as he levelled the game in the 48th minute.
Enner Valencia had given Ecuador the lead midway through the first-half as he scored for the fifth successive game for his country.
Victory was Switzerland’s first over South American opposition in the World Cup finals having lost their previous four and the win had even veteran coach Ottmar Hitzfeld jumping up and down for joy in what is his farewell tournament.
Ecuador had started the brightest and it was little surprise when they went ahead in the 22nd minute as former captain Walter Ayovi whipped in a superb freekick from the left and the unmarked Enner Valencia rose to send his header past Diego Benaglio and into the net.
The Swiss were finding it hard to settle and it took them almost half an hour to conjure up their first chance as Valentin Stocker beat his marker to a corner but his header went just wide.
That seemed to give them some confidence and 10 minutes before half-time captain Goekhan Inler worked some space and unleashed a vicious low shot that Ecuador goalkeeper Alexander Dominguez did well to get down to and turn away for a corner.
However, Dominguez was all at sea for the Swiss equaliser losing himself behind two defenders as the corner came in from Ricardo Rodriguez and Mehmedi, who scored 13 goals for Freiburg in the Bundesliga last season, rose above Carlos Gruezo to head home for his second goal for his country.
The lively Enner Valencia then produced a lovely piece of skill and unleashed a fine effort from outside the box which went narrowly wide of the Swiss goal.
The equally impressive Jefferson Montero then tore into the right flank of the Swiss defence and created a good opportunity for himself which Benaglio got down to turn away for a corner.
The Swiss countered and thought they had taken the lead when Josip Drmic, who Hitzfeld had preferred to Seferovic, put the ball into the net after a neatly worked move but it was ruled out for offside.
Both teams were not content to settle for a draw even as the match entered time added on and it was Ecuador who looked like they had grabbed the three points when Michael Arroyo was shaping up to shoot inside the area only for a superb tackle by Valon Behrami to dispossess him.
Behrami showing the hard-headed experience of a man appearing in his third World Cup finals, then pushed forward and although he was subject to a crunching tackle in the middle of the pitch the referee played a brilliant advantage in waving play on.
The ball was worked out to the left flank and when it was whipped in Seferovic was on hand to tuck the ball inside the near post and send the Swiss contingent wild.