Somerset 158 for 5 (Gregory 57*) beat Nottinghamshire 157 for 6 (Montgomery 51, Overton 2-23) by five wickets
Somerset lost five wickets by the midway point of their reply before Gregory and Green put together an unbroken partnership of 96 to see their side to Edgbaston with three balls to spare.
A big moment in the game came as early as the fourth delivery, Notts opener Alex Hales advancing to Overton and making room for a big shot, only to have his stumps scattered. Overton soon followed up by having the dangerous Colin Munro brilliantly caught by the back-peddling Matt Henry at mid-off.
Henry then had Joe Clarke pouched at midwicket by Overton to make it 17 for 3 and although Montgomery and Patel took boundaries off the sixth over, bowled by Jack Brooks, the Outlaws ended the powerplay on 37 for 3.
Patel pulled a six off Gregory as 14 came off the ninth over. He and Montgomery had taken their stand to 69 when the 13th over saw Patel bowled trying to swing Gregory into the leg side.
Montgomery survived a tough chance to Tom Abell in the outfield to bring up his half-century, but the next ball saw him sky another catch and Overton made no mistake running in from long-off.
Tom Moores was caught at short fine-leg off Gregory and after Sodhi's economic contribution, it was left to Wasim and skipper Steven Mullaney to boost a meagre Notts total with some clean hitting in the final overs. Wasim struck a six and two fours in his entertaining cameo, but the Outlaws looked to face an uphill battle at the halfway stage.
Their spirits were lifted when Tom Banton was caught behind reverse-sweeping off the first ball of the second over of Somerset's innings, sent down by Wasim, the umpire's decision of not out being reversed after a referral. It was 9 for 2 when the left-arm spinner completed a double-wicket maiden by clean bowling Tom Kohler-Cadmore for a duck.
Smeed responded by hitting boundaries off the first three balls of Wasim's second over. Abell produced three sweetly-struck fours of his own as the pair took Somerset to 44 for 2 by the end of the powerplay. The pair had added 46 when Abell played a ball from Calvin Harrison into the leg side and Smeed called for a second run, only to fall short as Hales produced a fast throw to the bowler's end.
Soon afterwards, Sean Dickson fell lbw to Harrison reverse-sweeping and Abell walked after under-edging a catch behind in the same over. At the halfway stage of their innings, Somerset were 62 for 5.
The experienced Gregory then took charge, clearing the ropes off Patel twice and Wasim as he and Green, who smashed Harrison over long-on for six, repaired the damage in style, bringing up a half-century stand off 35 balls.
Thirty were needed off the last three overs. Gregory brought a packed crowd to their feet with a six over midwicket off Wasim and went to a brilliant 32-ball fifty with another maximum over long-off in the penultimate over, delivered by Jake Ball, to finally break Notts' resistance.
With three needed, Green appeared to be dropped at cover off Fletcher. But it was a no-ball and the resulting free hit was dispatched for the winning runs.