Set a target of 218 off 34 overs, Jack Taylor's 34 off 17 balls and Geraint Jones's unbeaten 39 saw them to 218-6 with an over to spare.
Michael Klinger, dropped on nought, was the pick of the batsman with a fine 87.
Earlier, Hampshire's Jimmy Adams was run out for 97 and Will Smith hit 50 off 25 balls in the visitors' 217-7.
After four inspections because of overnight rain, play finally got under way at 13:45 BST - a delay of more than three hours.
Having been asked to bat, Hampshire slumped to 1-2 with Michael Carberry dismissed for a three-ball duck while Adam Wheater joined him in the pavilion shortly after.
As the early-morning gloom was replaced by mid-afternoon sunshine, Hampshire's batting improved, led by Adams - who was celebrating his 100th List-A appearance for the south coast side.
But his 99-ball innings, which included six fours and two sixes, came to an end three runs short of a deserved century when he was run out by James Fuller while attempting to come back for a second.
Media playback is not supported on this device
In the chase, Gloucestershire were thankful for a dropped catch from Adams with Klinger yet to score, but at the halfway stage of their innings they were 81-3 with Chris Dent, Gareth Roderick and Hamish Marshall the men to fall.
Klinger looked to be taking the hosts to victory as he upped the run-rate, but was eventually caught by Adams to leave Gloucestershire 163-5 - still needing 55 off 33 balls.
However, two big overs of 19 and 17 runs gave Gloucestershire hope before Taylor gave his wicket away with 11 required.
But Jones smashed a six to take his side to victory, with Gloucestershire now facing an away trip to either Yorkshire or Essex.
Gloucestershire sealed a place in the semi-final of the One-Day Cup after winning a thrilling rain-reduced match against Hampshire in Bristol.