Set 302 to win from 46 overs at Taunton, Middlesex needed eight from the last and Simpson lofted Jim Allenby over long leg to finish 79 not out.
Nick Gubbins contributed 76 and James Fuller smashed 36 from only 18 balls.
Somerset, 348-6 overnight, earlier declared on 446-9 to give Middlesex an invitation they were happy to accept.
The visitors, who began the game with a one-point lead at the top of County Championship Division One, extended it to 14 points because of Warwickshire's draw with Hampshire and Lancashire's week off.
The catalyst for victory came from Fuller, who took three wickets in the morning session then provided acceleration to the run chase.
With 109 needed from nine overs, Fuller, who had survived a loud appeal for caught behind off Tim Groenewald, hit the same bowler for successive sixes over extra cover in an over that cost 22.
His onslaught jolted Simpson into life, with the wicketkeeper taking up the chase after Fuller and Ollie Rayner fell in the same Jack Leach over.
Allenby was given the responsibility of the final over and with six needed from four balls, Simpson swept a leg-stump delivery over the longest boundary on the ground.
It completed a remarkable chase, one that Middlesex looked to have abandoned after Sam Robson, Dawid Malan, Gubbins and George Bailey fell in quick succession, all four to Groenewald, who finished with 5-90.
A sedate passage with Simpson and James Franklin at the crease followed, but Fuller arrived to make things happen, just as he had with the ball in the morning session.
He took all three wickets to fall before lunch, including Peter Trego, who made 138, for figures of 3-125.
Middlesex were held up by last-wicket pair Leach and Groenewald until midway through the afternoon, when Somerset captain Chris Rogers declared.
It led to a thrilling climax, with all four results possible until Simpson, on his 28th birthday, struck the decisive blow.

A blockchain-based smart plug that can adjust power consumption minute-by-minute has been created by technologists at Accenture.
The blockchain is the automated ledger that underpins Bitcoin and tracks where the coins are spent and swapped.
The plug shops for different power suppliers and will sign up for a cheaper tariff if it finds one.
Accenture said the smart plug could help people on low incomes who pay directly for power.
The smart plug modifies the basic Bitcoin blockchain technology to make it more active, said Emmanuel Viale, head of the Accenture team at the firm's French research lab that worked on the plug.
Instead of just resolving and confirming transaction records, the Accenture work has changed the blockchain to let it negotiate deals on behalf of its owner.
"It's about how we put more business behaviour or logic into the blockchain," said Mr Viale, adding that this essentially embeds a "smart contract" into the digital ledger.
The smart plug prototype works with other gadgets in the house that monitor power use. When demand is high or low it searches for energy prices and then uses the modified blockchain to switch suppliers if it finds a cheaper source.
So far, said Mr Viale, the Accenture system was just a proof of concept, but it could help many people on lower incomes who pay for their power via a meter.
Being able to quickly shift suppliers could save this group more than Â£660m in the UK annually, suggests Accenture research.
A blockchain-based system that can act on behalf of its owner might also prove useful as the Internet of Things becomes more ubiquitous, said Mr Viale.
Managing many different gadgets might be tricky without a more centralised system, he said,
Martin Garner, a mobile services expert at analyst firm CCS Insight, said blockchains were starting to crop up in many different areas including share trading, fishing rights databases and land registry claims.
They had two chief attractions for the Internet of Things, he said.
"They avoid dependence on any one supplier or ecosystem  - some users have concerns about the potential dominance of key internet players creating, for example, the Google-of-Things or the Amazon-of-Things," he said.
"The second attraction is as a way of enabling autonomous trading between things, such as the appliances in your house being set up to re-order supplies from a pre-approved list of suppliers," he added.
Middlesex's John Simpson hit a six with two balls remaining to seal a thrilling two-wicket win over Somerset in County Championship Division One.
[NEXT_CONCEPT]
The technology behind the Bitcoin virtual currency could help cut electricity bills, suggests research.