Fabio Quagliarella opened the scoring in Genoa but the home side came storming back through Eder and Lorenzo De Silvestri, Mauro Icardi's tap-in ultimately proving 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 their first win since March - but their 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.
Quagliarella then dragged a shot just wide before Emanuele Giaccherini called da Costa into action once again, as Juventus continued to pepper the Sampdoria goal with shots.
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 penalised 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.
Chiellini then very nearly put Juve back into the lead just before the interval but he mistimed his jump ever so slightly, and headed over with the goal at his mercy.
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 team-mate'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, they were 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.
Juve kept fighting, and Giaccherini smashed in a late goal for the visitors, but they had left it too late to salvage something from their final game of an otherwise triumphant season.