Middlesex 324 (Robson 154, Davis 5-66) and 176 for 7 (Eskinazi 53*) lead Leicestershire 228 (Ackermann 82, Inglis 49) by 272 runs
Stevie Eskinazi made an unexpected return from injury to score a vital half-century and strengthen Middlesex's hopes of forcing a rare LV= Insurance County Championship victory against Leicestershire.
Eskinazi, who had seemed unlikely to play any further part at Merchant Taylors' School after he pulled up in pain while batting on day one, emerged with a runner to salvage Middlesex's second innings after they crashed to 17 for 4.
The 27-year-old blunted the Leicestershire attack and top-scored with a gritty 53 not out as he and James Harris shared a sixth-wicket partnership of 77, lifting Middlesex to 176 for 7 at stumps - a lead of 272.
That leaves the Foxes, who were earlier dismissed for 228, with the prospect of chasing an awkward target on the final day.
Resuming on 174 for 5, Leicestershire chipped away at the deficit until the introduction of Daryl Mitchell paid immediate dividends, with both Ben Mike and Callum Parkinson caught behind.
Wicketkeeper Robbie White claimed his fourth catch of the innings when Ed Barnes, fuelled by the momentum of last week's career-best 83 not out against Somerset, misjudged an ambitious pull shot against Harris.
Foxes captain Colin Ackermann, having spent almost five and a half hours over his watchful 82, eventually fell to an Ethan Bamber delivery that swung away to hit off stump.
The Middlesex seamer finished with 3 for 54 when the diving Joe Cracknell caught last man Will Davis low at first slip - but the home side's lead of 96 was made to look flimsy as their top order crumbled second time around.
Davis added another three wickets to his five from the first innings, while Ackermann completed a trio of slip catches, the best of them at shoulder height to remove Josh de Caires.
However, Mitchell and White batted sensibly to repair the damage, adding 38 before the New Zealander was adjudged lbw to Mike despite the hint of an inside edge.
White, dropped early on by Davis at third slip, went on to make 34 and looked on course for a potential match-winning knock until he chipped Parkinson to backward square leg just before tea.
But Eskinazi, having taken almost half an hour to get off the mark, held firm and joined forces with Harris in a resolute stand that combined patience with good shot selection.
Barnes eventually pinned Harris lbw for 26 with an inswinging yorker, but Eskinazi carved the last ball of the day for four to bring up his half-century.