Derbyshire 205 (Bamber 5-41) and 42 for 1 need 292 more runs to beat Middlesex 282 and 256 (Robson 52)
A last-wicket stand of 58 between Toby Roland-Jones and Tim Murtagh leaves Derbyshire needing the fifth-highest run chase in their history ahead of day four at Lord's.
The two pacemen missed eclipsing Middlesex's 10th-wicket record against Derbyshire of 66 set three years ago, but their effort carried the hosts to 256 all out, a lead of 333, Alex Thomson taking 3 for 71.
Murtagh then removed Luis Reece as somehow Derbyshire limped to 42 for 1 in an absorbing last session truncated by bad light, still needing 292 for victory.
Earlier, Ethan Bamber took Derbyshire's last first-innings wicket to record a career-best 5 for 41.
Bamber needed just five balls to register his landmark, having Sam Conners caught at mid-wicket.
Middlesex, leading by 77 made the worst possible start as Mark Stoneman, on debut and on a pair, shouldered arms to the first ball of the innings from Conners and lost his off stump.
It was the cue for a frenetic second innings effort from the hosts, who constantly seemed in too much of a hurry to build on their advantage.
Stephen Eskinazi's boundary-sprinkled cameo ended with an ugly shot caught at point and first innings centurion Robbie White fenced at a wide one to be caught behind for nought.
Sam Robson was the exception, leaving well outside off stump and driving bad balls to the boundary on both sides of the wicket.
This mix of judgement and aggression took him to 50 in 55 balls with nine fours as he shared a half-century stand with Max Holden for the fourth wicket.
But on 52, Robson suffered a rush of blood, charging off-spinner Thomson who bowled him through the gate.
Holden and Martin Andersson each threatened to establish dominance only to fall for 44 and 41 respectively, the latter the second of two wickets in seven balls for Anuj Dal as the Seaxes slumped to 198 for 9.
But Murtagh and Roland-Jones (33 not out) wrestled back control with a mix of good running and aggression.
Inspired by his 31, Murtagh then removed Luis Reece for a duck via an edge through to John Simpson and 46 balls passed before a run was scored as Billy Godleman and Tom Wood clung on amid numerous appeals like wounded boxers in need of the bell.
Relief came with Middlesex forced to bowl spin before a second interruption for bad light brought play to a close 11 overs early.