Derbyshire 188 for 8 (Masood 75, Madsen 70) beat Lancashire 183 for 5 (Croft 47, David 42*) by five runs
The fast bowler had gone for 48 from his first three overs but conceded only five off his last as the North Group leaders came up short on 183 for 5, chasing 189.
After the Lightning elected to bowl, the Falcons were restricted to 44 from the powerplay for the loss of Luis Reece who sent a return catch to Tom Hartley off the fifth ball of the innings.
The ball crossed the ropes only four times during the first six overs, four of those overthrows, and Hayden Kerr's attempt to break the shackles two overs later ended in the hands of cover.
That brought together Madsen and Masood who accelerated with a mixture of orthodoxy and improvisation.
Masood lofted Luke Wells down the ground before Madsen scooped Tom Hartley over the wicketkeeper for four and then drove the left-armer to the cover boundary.
Masood hammered Danny Lamb back over his head for four on his way to his fifth 50 of the competition, a record for Derbyshire, and Madsen powered to his half-century off only 23 balls.
He pulled Wells over midwicket for the first six of the innings as 19 came from the 14th over and Masood tore into Lamb in the 16th, driving and pulling the seamer for two sixes before lifting a full toss to mid off.
But Madsen was striking the ball with power and precision, taking 18 off four balls from Richard Gleeson before he was lbw to the next.
The pair had plundered 64 from four overs but the Lightning recovered well with Luke Wood and Gleeson conceding only 20 from the last three overs.
Even so, it left the Lightning with a tough chase and they lost Phil Salt in the third over when he was superbly caught by Leus du Plooy diving at deep square leg.
Wells pulled Mark Watt for two sixes in the next over and Croft dispatched Scrimshaw for another six with 19 coming off the fifth.
The powerplay ended with the Lightning 64 for 1 and Scrimshaw came in for more punishment in his second over with Croft pulling him for six before Wells called for a new bat and promptly struck two fours.
Croft was dropped on 33 at short fine leg off Alex Hughes but du Plooy took another good catch to remove Wells who pulled the off-spinner to deep midwicket.
The Lightning needed 91 off 10 overs but the Falcons were stemming the run flow and Dane Vilas was caught behind cutting Matt McKiernan in the 12th over.
Croft launched Hughes over long on for six but was brilliantly caught at backward point off Watt in the 14th over.
David responded by pulling and driving McKiernan for two sixes and another six off Scrimshaw left the Lightning needing 33 off 24 balls.
Kerr and Watt conceded only 10 off the next two overs and although Rob Jones pulled Kerr for four, the Lightning needed 11 off six balls.
Scrimshaw delivered when it mattered, trapping Jones lbw with his fifth ball before Lamb missed a wild swing at the last to end another T20 thriller.