Karl Brown and Paul Horton put on 82 to chase down their target of 185 in a low-scoring match.
And after both went with 15 runs still required, Ajmal Shahzad smashed 10 off just five balls to help Lancashire over the line with five deliveries to spare as they leapfrogged their opponents in the table.
Ian Cockbain had made 58 off 49 balls, including 30 in seven deliveries in the final two overs, to push what looked like being a below-par Gloucestershire total into a challenging 184 for seven.
Cockbain, who earlier in his career played for Lancashire seconds, also claimed a stunning catch at point to end what was becoming a dangerous knock by Stephen Moore, who made 37. But Horton, who dislocated his finger while fielding, made 46 and Brown 60 to steer Lightning into pole position in the race to reach the semi-finals.
After Gloucestershire won the toss, Lancashire made an early breakthrough when Rob Nicol slashed a Shahzad delivery straight to Glen Chapple in the third over. Benny Howell quickly followed as he edged the impressive Chapple to wicketkeeper Gareth Cross.
Hamish Marshall had made 23 when he was trapped lbw by an Oliver Newby yorker as the Gladiators struggled to 35 for three. Alex Gidman and Dan Housego steadied the ship with a 47-run partnership before Newby returned to demolish Gidman's stumps and Gary Keedy then bowled Housego for a gritty 43.
Cockbain put on 42 with Chris Dent (27) and then helped the visitors pile on 52 runs in the last five overs before he was stumped off the final delivery of the innings.
Moore and Ashwell Prince gave Lancashire a solid start to their reply, putting on 43 before Prince was surprised by extra bounce and chipped David Payne - who finished with three for 39 - to Nicol.
Stephen Croft went for three when he top-edged a sweep off Ed Young and then Cockbain pulled off a stunning diving catch at backward point to end Moore's knock. But Horton and Brown overcame the tough batting conditions to set up the Lancashire victory before Horton was trapped lbw to James Fuller and Brown holed out to Payne.
Kent Spitfires kept their Clydesdale Bank 40 campaign alive with a nine-wicket Group C victory over Derbyshire Falcons under the Duckworth/Lewis method at Derby.
The floodlit match was delayed by nearly four hours by rain, reducing the contest to 14 overs a side, but after Derbyshire made 62 for five, Kent were left with a target of 67 and got home with 19 balls to spare.
Rob Key fell to Mark Turner for 17 but Sam Billings (28) and Sam Northeast (22 not out) easily took the Spitfires to a victory that gives them a chance of claiming the best runners-up spot.
The Falcons had reached 22 without loss after being put in but there was assistance for the seamers on an overcast evening and it was no surprise when Chesney Hughes edged a drive at one from Matt Coles that moved away and was caught behind for 11.
Usman Khawaja went in the next over when he chopped Azhar Mahmood into his leg stump and Wes Durston became the third batsman to fall for 11 when he was caught behind pushing forward at Darren Stevens.
Falcons skipper Wayne Madsen became Stevens' second victim when he was bowled through a big gap with the total on 46 but that was the last action for nearly three-and-three-quarter hours as the rain set in.
The game was able to resume at 9.15pm with the Falcons left with one over to boost their total and after Dan Redfern was run out off the first ball going for a second, Jon Clare hit James Tredwell high over mid-wicket for six. He then swung the spinner for another four and finished unbeaten having joined the massed ranks on 11.
Alex Hughes clubbed another boundary as 16 came off the over to leave the Spitfires chasing a revised target of 67 but the advantage was still very much with the visitors, especially with the Falcons' bowlers having to contend with a wet ball.
Billings and Key knew they did not have to take any risks but 23 came off the first three overs to dash the slim hopes of the home side, who had to take early wickets to exert any pressure.
Key pulled Mark Turner for his third four but was then caught behind down the legside off the next ball for 17 with the total on 39. But Kent needed only 24 off the last seven overs and the outcome was never in doubt. Northeast sealed victory in the 11th over with consecutive fours off David Wainwright to give Kent a chance of making the semi-finals.