Bastia have come from behind twice against Valenciennes to win their Ligue 1 encounter 4-3 away from home.
The hosts drew first blood after nine minutes when Remi Gomis turned in Gael Danic's delivery from close range.
Bastia restored parity on 20 minutes through Toifilou Maoulida, who latched onto Fethi Harek's through-ball to fire home from inside the Valenciennes penalty area.
However, the visitors failed to build on that equaliser and conceded the second goal on the half-hour mark.
Maka Mary handled the ball inside the Bastia box and Danic successfully converted the resultant spot kick.
However, Bastia stepped up their game in the opening minutes of the second period and made it 2-2 in the 49th minute, Maoulida heading home Julian Palmieri's cross to add to his tally.
Bastia made it 4-3 with six minutes of normal time left on the clock. Gaetan Bong conceded a penalty by handling the ball inside the Valenciennes penalty box, and Florian Thauvin made no mistake from 12 yards.
Thauvin made the game safe for the visitors in the 89th minute with his second goal of the match, firing in from close range following a counter-attack.
Gregory Pujol scored the hosts' third goal of the evening in the fourth minute of stoppage time, but that failed to make any impact on the final result.