Fabio Quagliarella and Keita Balde Diao gave Sampdoria victory, but Fiorentina will regret missed opportunities at Marassi.
Keita Balde Diao struck at the near post on a Gaston Ramirez corner to put the Blucerchiati in front.
Emil Audero made a sensational double save on Erick Pulgar and Dusan Vlahovic, but the second attempt had crossed the line.
The two Samp substitutes combined to win it, as Antonio Candreva set up veteran Quagliarella from the edge of the box.
German Pezzella, Cristiano Biraghi and Nikola Milenkovic all had chances to snatch a draw.