Sagan claimed his 14th stage win at the Swiss race ahead of Michael Albasini (Orica-Scott) and Matteo Trentin (Quick-Step Floors) at the end of the 222km ride from Bex to Cevio.
"It took a little while to get this win. the first road stage was a little mad, with attacks and a really hectic finish, then two days ago it was a good finish but I’d put in a big effort before to get up the final climb," Sagan said.
"Today was really good for me though. There was a bit of rain but I felt much better in the end and managed to keep my head in the finale.”
Caruso (BMC) maintained his 16-second lead over Steven Kruijswijk (LottoNL-Jumbo) with Domenico Pozzovivo (AG2R) third at 25sec.
"The start was really fast, and many riders tried to make it into the breakaway so, it took over 70km for the final breakaway to form," Caruso said.
"The pace was really high. I think we were going at around 50km/h for the first two hours. We were then setting a good tempo on the long climb before the second part of the race which was pretty technical especially the descent.
"The guys did a really amazing job to keep me in a good position and in the end, I finished safe. For me, that was the most important thing."
It was a terrible day for last year's champion Miguel Angel Lopez (Astana), who was taken to hospital after crashing badly on a fast descent midway through the stage.
At that point, there was a six-man breakaway that had eked out a lead of six minutes at one stage. But its last two holdouts, Ben King (Dimension Data) and Jesper Asselman (Roompot-Nederlandse Loterij), were caught with just 6km remaining.
The 166.7km sixth stage from Locarno to La Punt has an uphill finish that should see the overall contenders do battle.