Fabio Quagliarella opened the scoring in Genoa but the home side came storming back through Eder and Lorenzo De Silvestri, and Mauro Icardi's tap-in ultimately proved decisive
Fabio Quagliarella deservedly opened the scoring for the Bianconeri midway through the first half but the hosts levelled courtesy of a penalty from Eder before sensationally taking the lead through Lorenzo De Silvestri just before the hour mark.
Mauco Icardi then added a third for the Blucerchiati and that goal ultimately proved decisive. Emanuele Giaccherini struck in injury time to set up a tense finale, but Samp held on to claim its first win since March - but its second over Juventus in the space of five months.
Antonio Conte made several changes in personnel for what was a meaningless contest for both sides, but the Bianconeri began brightly, with Sebastian Giovinco, Quagliarella and Giorgio Chiellini all testing Junio da Costa with decent strikes from distance inside the opening quarter.
Juve's relentless pressure finally told 25 minutes in when Quagliarella sprung the Blucerchiati offside trap to latch onto a terrific ball over the top from Andrea Pirlo before calmly slotting home.
A rout looked a distinct possibility at that stage but the concession of a goal actually brought the best out of the hosts, who levelled matters from the penalty spot through Eder, after Chiellini had been harshly penalized for a push on Mauro Icardi in the area.
Remarkably, Sampdoria almost went in front just 60 seconds later, but Chiellini made amends for his earlier indiscretion to block a low strike from Eder that had been destined for the bottom left corner.
The second half began in a very similar manner to the first, with the Bianconeri launching wave after wave of attacks on the Sampdoria goal.
Indeed, Quagliarella and Giaccherini had both been guilty of poor finishes before Giovinco put Simone Padoin straight through on goal with the most sublime lay-off only to see his teammate's effort brilliantly saved by da Costa.
Again, the goal was coming, only this time it came at the other end, with De Silvestri beating Storari with a near-post header from a corner.
Juventus dominated the final half-hour and Quagliarella really should have restored parity on 70 minutes but he volleyed tamely at da Costa after being picked out unmarked eight yards out by a measured chip from Giovinco.
However, it was then hit with a classic sucker-punch just moments later, with former Bianconero Marcelo Estigarribia racing clear down the right flank before rolling the ball across the box for a grateful Icardi to tap in.
Juventus kept fighting, and Giaccherini smashed in a late goal for the visitor, but Juve had left it too late to salvage something from its final game of an otherwise triumphant season.