The pair had been part of a decisive break in the peloton caused by an acceleration of pace injected by the Quick-Step Floors team. Damien Gaudin (Direct Energie) came in for third place.
It's Terpstra's first victory for two years and a sign that the 2014 Paris-Roubaix winner could be back on top form for the forthcoming Classics.
Having come away from the weekend's Omloop Het Nieuwsblad and Kuurne-Brussels-Kuurne empty-handed, Quick-Step Floors evidently decided to make amends by stamping their authority on the mid-week race, which features sections of cobbled roads.
The early part of the 200-kilometre race was led by a seven-rider escape group, which included Gaudin. Behind them, Quick-Step Floors were leading the peloton in the windy, freezing conditions, ultimately causing a split in the bunch.
The Quick-Step Floors-led group of 10 riders managed to make the junction with the front group of seven to make a new leading unit of 17.
They worked well together to open up a gap over the chasing peloton, and by the half-way point of the race the gap was creeping up towards a minute.
Four laps of a 25km loop made up the second half of the race, each lap containing sectors of cobbles and short climbs.
A furious game of cat-and-mouse was set up between the leaders and the bunch, but try as they might, the peloton could not make any in-roads into catching the escapees.
Heading into the final 60, there were just five riders left in the lead: Gilbert, Gaudin, Terpstra, Tosh Van der Sande (Lotto-Soudal) and Alex Kirsch (WB Aqua Protect).
There was a momentary wobble for Terpstra, who required a bike change, but he managed to chase back into the lead quintet.
Heading into the final 25km lap, Van der Sande and Kirsch found the pace too hot, and they were dropped – leaving just Terpstra, Gilbert and Gaudin. It soon became clear that the peloton had lost its impetus, and the win would be contested from this small group, and with Gaudin at a distinct disadvantage.
Gilbert attacked first, forcing Gaudin to chase with Terpstra sat on his wheel. Then Terpstra attacked – in what would be the decisive move.
Terpstra slipped into time trial mode, and opened up a gap over the tiring Gaudin – who let us not forget had been part of the day's initial escape – with Gilbert sat on his back wheel.
Unsurprisingly, Gilbert then dropped Gaudin in the final 3km, setting up a Quick-Step one-two that will please the home fans left disappointed after the opening weekend.
Earlier, Janneke Ensing (Alé Cipollini) had won the women's edition of Le Samyn. She finished ahead of Flootje Mackaij (Team Sunweb) and Lauren Kitchen (FDJ) at the end of the 103-kilometre event.
Le Samyn 2018, 200km
1. Niki Terpstra (Ned) Quick-Step Floors
2. Philippe Gilbert (Bel) Quick-Step Floors
3. Damien Gaudin (Fra) Direct Energie
4. Adrien Petit (Fra) Direct Energie
5. Gediminas Bagdonas (Ltu) Ag2r La Mondiale
6. Alex Kirsch (Lux) WB Aqua Protect Veranclassic
7. Benoit Jarrier (Fra) Fortuneo-Samsic
8. Nico Denz (Ger) Ag2r La Mondiale
9. Frederik Backaert (Bel) Wanty-Groupe Gobert
10. Alexandre Pichot (Fra) Direct Energie
Thank you for reading 10 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1