But South Africa have been much improved in the field since that 41-run defeat and this win gave them a first T20I series success in England, as well as their first white-ball bilateral series victory in the country since 1998.
"Before I came to the game, my wife casually said she wants four wickets," Shamsi said at the presentation ceremony.
"And I looked at her to say 'as if you can just buy wickets at a supermarket?'. That's why I was a bit more animated in my celebrations today."
Defeat left England still searching for a first series-win under new white-ball captain Jos Buttler following one-day international and T20I reverses against India and a drawn ODI campaign with the Proteas.
Jonny Bairstow (27) was the only England batsman to make more than 20, but Buttler and coach Matthew Mott do have at least seven matches at this level scheduled in Pakistan in September in which to turn things around before the T20I World Cup in Australia.
"The way we went down, is the most disappointing thing," said Buttler. "We lacked intent and confidence and didn't manage to put the opposition under pressure. It's not for the lack of trying, we just haven't performed as we'd like to as a group. We have to just go back and reflect. There's a huge competition on the way."
England's chase suffered an early setback when Buttler was out for 14, caught at short third man off spinner Keshav Maharaj.
The out-of-form Jason Roy fell for 17, caught behind off Anrich Nortje -- in after South Africa decided against risking fellow fast bowler Kagiso Rabada's injured ankle ahead of next month's three-Test series in England.
And when Moeen Ali was brilliantly caught one-handed by a leaping Tristan Stubbs off part-time spinner Markram, the hosts were 59-4.
Shamsi then cleaned up Liam Livingstone before taking two wickets in two balls, with Sam Curran caught in the deep before Willey was clean bowled.
Chris Jordan survived the hat-trick only to be lbw to Shamsi.
Adil Rashid holed out off Shamsi before Maharaj ended the match when he dismissed Bairstow with the aid of a catch by David Miller -- a memorable way for the South Africa captain to finish his 100th T20 international.
England's decision to recall Willey in place of Richard Gleeson reaped an early reward when he had Quinton de Kock chopping onto his stumps for a three-ball duck.
But South Africa recovered, with Hendrick completing a 42-ball fifty.
He was eventually well caught by wicketkeeper Buttler off the expensive Jordan (1-52).
But Markram, back in South Africa's T20 team for the first time since last year's World Cup, having first provided solid support, went on to a 36-ball fifty before Miller chipped in with a quickfire 22.