In a stage that was always likely to end in a bunch sprint after 193 kilometres from Flims to Schwarzenbach, Orica's Matthews edged out stage three winner Sagan and Belgium's Greg van Avermaet.
Sagan came into the sprint as the favourite with already ten Swiss stage successes to his name but Matthews hunted him down in the final few metres to take his first victory at the event.
Dutchman Dumoulin leads Sagan, who took a time bonus on the line, by just a single second in the overall standings with Spaniard Daniel Moreno third.
However, the general classification is expected to be turned on its head after Wednesday's torturous 237-kilometre mountainous stage that will see the overall contenders come to the fore.
Frenchman Thibaut Pinot, third at last year's Tour de France, will expect to shine with less than three weeks to go before the Grand Boucle begins.
He's ideally placed at fourth overall, 15 seconds back from Dumoulin, and showed last month he has good climbing legs as he won a mountainous stage at Switzerland's Tour de Romandie.