It gave Alan Pardew's side consecutive league wins for the first time since last December and saw the south London club climb to eighth place in the table.
Mark Hughes's Stoke, who replied through Marko Arnautovic, were left bottom of the pile after registering four successive league defeats for the first time since February 2012.
With eight minutes gone, Townsend floated a free-kick towards the far post and Tomkins crept in behind Jonathan Walters to toe the ball past Shay Given from close range.
Once renowned for the rigour with which they defended set-pieces, Stoke conceded another goal from a dead-ball situation just three minutes later.
Stoke's response, such as it was, was tame, with Wilfried Bony meekly curling wide.
Tomkins limped off at half-time and was replaced by Delaney, but it did not affect the hosts' rhythm.
Townsend saved the best for last, drifting infield from the left, beating Joe Allen with a neat chop and then bending a low shot into the bottom-right corner.
Arnautovic curled in a goal for Stoke from the edge of the box in injury time, but by then the damage had been done.