Leicestershire 143 for 6 (Cosgrove 57*) beat Derbyshire 139 for 7 (Critchley 72*) by four wickets
Leicestershire ensured they will go into their final group match, against Nottinghamshire at Trent Bridge, knowing that a win will see them qualify for the quarter-finals.
The Foxes' four wicket win over the Falcons means that Derbyshire must also win their final match, at home to Worcestershire, to be certain of going through to the knockout stages for the first times since 2005 - although they will also qualify if Leicestershire are beaten by Notts.
"We're over the moon. We knew we would probably have to win our last four games to qualify, and we've still got a chance of doing that - it's not how you start a competition, it's how you finish it that counts," Leicestershire head coach, Pierre de Bruyn, said.
"We were very good in the field tonight, and Aadil Ali isn't really a part-time bowler, he's worked really hard on his offspin over the last year. Then Mark Cosgrove was outstanding, you need a calm head from a senior player in these sort of circumstances, and he controlled our innings.
"We know what we're up against at Notts, but we have momentum, and they will know we are a dangerous side. It's like a mini quarter-final for us."
Put in on a slightly slow pitch, Derbyshire struggled from the start, scoring just 34 from the six-over Powerplay, and losing their three leading run-getters in reaching just 46. First to go was Billy Godleman, the left-hander losing his leg stump to Gavin Griffiths bowling around the wicket, and Luis Reece quickly followed, caught and bowled off a leading edge by Ali.
The key wicket, however, was that of Wayne Madsen, who came into the match having hit 457 runs in the competition this season, but had scored only 10 when he reverse-swept Ali straight into the hands of Callum Parkinson at backward point.
With wickets falling at the other end, opener Matt Critchley set his stall out to bat through, and did so successfully, going to a run-a-ball 50 with a six, and finishing on 72 off 60 balls as the Falcons hit 44 from the last four overs of their innings to give their bowlers something to bowl at.
Leicestershire's reply was a nervous one, though it should not have been after they were given their customary flying start by Luke Ronchi. The former New Zealand international lost opening partner Cameron Delport to a fine diving catch by Madsen at backward point, but had hit 32 off 14 balls before he holed out to Alex Hughes at mid-on off Madsen.
Colin Ackermann was run out after a fine piece of fielding by Matt Henry, but Cosgrove's experience was vital as the Australian shepherded the Foxes home, reaching his 50 off 40 balls, and winning the match in the penultimate over with a four over midwicket.
Derbyshire captain Daryn Smit said: "It was a strange surface, it looked good, but it didn't really come on to the bat, and perhaps we should have played a little differently. The batters have done in week in week out this season, but they were bound to have a slip-up eventually. Critch was brilliant but we knew we were 20 runs shy and we'd have to be unbelievable in the field the restrict them. We weren't far off but one good innings by Cosgrove got them over the line.
"We kept fighting though, and showed a lot of character. We have to win tomorrow to be sure of going through, it's in our hands and we have to go out and do it in front of a good crowd."