The New Zealander, dropped on two, struck four sixes in his innings of 39 off 24 balls to help his side chase 176.
The result was harsh on youngster Max Holden, whose 84 was the backbone of Middlesex's 175 for five.
Dwayne Bravo also featured strongly for the hosts with a sparkling 32 not out off 12 balls and two wickets in as many balls.
Eoin Morgan opted to bat after winning the toss and openers Paul Stirling and Holden produced a bright start with 27 in three overs.
But Stirling (19) perished at the hands of Roelof van der Merwe when his paddle to the final ball of the fourth over failed to clear short backward square.
Former England Under-19s captain Holden continued to attack, hitting successive fours off Craig Overton as the Lord's tenants reached 52 for one at the end of the powerplay.
The boundaries though dried up and Stevie Eskinazi holed out in the deep off Max Waller in search of much-needed acceleration.
Holden completed 50 from 36 balls and eventually found the fence, hoisting Waller (two for 23) over deep mid-on. However, the spinner gained ample compensation in the same over when castling Morgan.
Holden responded by hitting Craig Overton for the first six of the game and another followed before one swing too many saw him bowled by the excellent Van der Merwe (two for 26).
But overseas aces Bravo and Ashton Agar, making his debut, supplied late impetus, the former hitting three sixes in succession.
Agar struck early in the visitors' reply having Steven Davies superbly caught by Stirling, but South African Johann Myburgh took heavy toll of a fit again Steven Finn, hitting him for a six and successive fours.
Agar too was smashed over long-on for a maximum, Myburgh drilling the next ball back to the Australian who shelled the difficult chance.
Peter Trego, so often the scourge of Middlesex, rubbed salt in the wounds by plundering another maximum from the last delivery of the spinner's over.
Tom Helm brought no respite as he too was pulled into the Allen stand as 50 came up inside five overs.
Bravo's introduction into the attack brought a new twist to the drama as he first uprooted Myburgh's middle stump to end a belligerent innings of 46 from 27 balls, before trapping James Hildreth lbw with his next delivery, leaving Somerset 59 for three.
Despite the double blow Somerset refused to be becalmed, Trego (32) again sending Agar beyond the ropes, but they were pegged back once more when he missed a short one from Nathan Sowter to be leg-before.
The biggest moment came when Sowter dropped a ball driven straight back at him by Anderson, the Kiwi celebrating the second chance by hitting Bravo back over his head for six in the next over and following it with three more off Sowter.
He eventually holed out in the deep off Helm who then bowled Tom Abell, but the damage was done and Somerset skipper Lewis Gregory hit the winning boundary with 12 balls to spare.
Related cricket links