Ibrahima Mbaye scored his first goals in Serie A to crown one of Livorno's best halves of football this season, but that was still not enough to ease their relegation worries.
Instead, Domenico Di Carlo's men capitulated in the second half with Nenad Krsticic bringing Samp back into the game before a Federico Ceccherini own goal drew them level.
Stefano Okaka and Manolo Gabbiadini then sealed the win for the Blucerchiati to take them 13 points clear of their opponents, who remain inside the bottom three having wasted a great chance to move out of danger.
Sampdoria did not heed the first warning when Paulinho stuck the crossbar from close range in the 12th minute, and they fell behind from the next Livorno attack seven minutes later.
Djamel Mesbah's shot was pushed onto the underside of the bar by Angelo Da Costa, but Mbaye was on hand to bundle the ball over the line.
A deflected Gabbiadini free-kick forced Bardi to track back and tip the ball onto the crossbar, but it was only a rare threat to the Livorno goal in the first half, and not long after that the visitors made it 2-0.
Leandro Greco took the ball to the goal line with a committed run and his low cross was guided on its way by Marco Benassi to Mbaye, who grabbed his and Livorno's second from close range.
Ceccherini almost made it three towards the end of the half, flashing his header just inches wide with the Sampdoria defence once again all at sea.
He did hit the target just after the break, but it was in his own net and allowed Sampdoria to draw level after Krsticic had buried a rebound to reduce the arrears in the 49th minute.
The two goals in four minutes gave the Blucerchiati the momentum to take the lead midway through the second half through Okaka.
His shot appeared to be heading wide of the far post before it took a deflection off the shoulder of Andrea Coda, leaving Bardi no chance in the Livorno goal.
Okaka then sent Gabbiadini through and his shot was turned wide by Bardi, but there was nothing the Livorno custodian could do the next time Gabbiadini went through, completing the turnaround and effectively sealing the points for Samp.