Derbyshire 189 for 5 (Madsen 109*) beat Leicestershire 187 for 5 (Ackermann 59*) by two runs
The 39-year-old's brilliant 61-ball innings, which contained 12 fours and four sixes, was his third hundred in the T20 format and his second in consecutive seasons after he made 100 not out against Durham last season.
It helped the Falcons post 189 for five after being put in, Tom Wood making 37 from 24 balls and Brooke Guest 25 from 20, spinners Rehan Ahmed (2 for 20), Callum Parkinson (2 for 36) and Colin Ackermann (1 for 16) sharing the wickets for the Foxes.
Left-arm spinner Parkinson dismissed both openers in his first two overs, Luis Reece leg before and Haider Ali bowled, both attempting to sweep, yet it was the Falcons, at 52 for two, who came out of the powerplay on top after being put in, despite the return to the Foxes attack of Naveen ul-Haq after his successful stint in the Indian Premier League.
Madsen's timing was immaculate as he dispatched Ahmed, Will Davis and Parkinson in turn for sixes out of the middle of the bat before cleverly reverse-sweeping Ahmed for four to bring up a 29-ball half-century - his fourth in as many innings this season - as the Falcons reached halfway at 96 for two.
Wood, after his uncertain start, was beginning to find his range when the Foxes at last managed to stem the flow, Wood reaching for one outside off stump and unable to control his shot, Sol Budinger pouching the catch at deep point.
That ended a 95-run partnership for the third wicket, after which the Falcons suffered a wobble as Ahmed struck twice in the space of five deliveries, having Leus Du Plooy caught behind down the legside for a second-ball duck before Anuj Dal fell leg before to the googly, 117 for two replaced by 120 for five on the scoreboard.
None of his colleagues could match Ahmed's economy on a night when the Foxes were sloppy in the field. Naveen conceded 23 off his final two overs as the last four of the innings saw the Falcons' total swell by 50 runs, Madsen lifting Davis over deep midwicket for his fourth six before driving Naveen through the covers to reach his hundred from 56 balls.
After a slow start to their reply in which Budinger lobbed tamely to mid-on as Zak Chappell claimed a wicket against his former county, the Foxes found some momentum in the second half of the powerplay to be 48 for one as Patel and Nick Welch began to find regular boundaries.
They lost Welch when the opener clipped a ball from left-armer into the hands of deep square leg and Patel had an escape on 33 when Zaman Khan spilled a chance on the legside off Du Plooy, but skipper Ackermann was into his stride with two fours and a six off George Scrimshaw as the home side reached 90 for two from 10.
Patel's second six, launched over long-on off Mark Watt, and two reserve sweeps for four by Ackermann off Wood kept the scoreboard moving nicely but after Patel holed out off Watt's left-arm aiming for another maximum the required rate was above 10. Wiaan Mulder thin edged behind off Chappell and the Foxes needed 55 from the last five overs.
Lilley fell for three, slashing Scrimshaw to deep backward point, but Ahmed uppercut his first ball for six to keep the Foxes interested and after a generally tidy over from Khan stretched the target to 39 from 18 balls, the sixth-wicket pair innovated nicely and ran well between the wickets to leave the Foxes needing 14 off the last over and put the pressure on Scrimshaw, who conceded a boundary to Ahmed from his first ball but the tall seamer held his nerve to avoid conceding another and the Falcons prevailed by two runs.