The 23-year-old LottoNL-Jumbo rider held off Great Britain's Dan McLay to win by half a bike length.
Team Sky's Ben Swift came third in the 218km stage, the longest of the eight-day race.
Yellow jersey holder Julien Vermote crossed the line in fifth to retain his six-second overall lead.
1. Dylan Groenewegen (Ned/LottoNL-Jumbo) 5hrs 28mins 49secs
2. Dan McLay (GB/Great Britain) same time
3. Ben Swift (GB/Team Sky)
4. Carlos Barbero (Spa/Caja Rural-Seguros RGA)
5. Julien Vermote (Bel/Etixx Quick-Step)
6. Boy van Poppel (Ned/Trek-Segafredo)
7. Luka Mezgec (SVK/Orica-BikeExchange)
8. Nicolas Vereecken (Bel/An Post-Chain Reaction)
9. Tom Dumoulin (Ned/Team Giant-Alpecin)
10. Diego Rubio (Spa/Caja Rural-Seguros RGA)
1. Julien Vermote (Bel/Etixx Quick-Step) 18hrs 22mins 04secs
2. Stephen Cummings (GB/Dimension Data) +06secs
3. Ben Swift (GB/Team Sky) +1min 03secs
4. Tony Gallopin (Fra/Lotto Soudal) same time
5. Daniel Martin (Ire/Etixx Quick-Step) +1min 04secs
6. Xandro Meurisse (Bel/Wanty-Groupe Gobert) +1min 08secs
7. Dylan van Baarle (Ned/Cannondale Drapac) +1min 12secs
8. Tom Dumoulin (Ned/Team Giant-Alpecin) same time
9. Guillaume Martin (Fra/Wanty-Groupe Gobert)
10. Nicholas Roche (Ire/Team Sky) +1min 16secs
Dutch national champion Dylan Groenewegen won stage four of the Tour of Britain in a sprint finish at the Royal Welsh Showground in Builth Wells.