Yorkshire stand on the verge of their first LV= County Championship victory at Lord's since 1987 after Middlesex closed day three on 137/4, still 78 behind after being forced to follow-on.
Adil Rashid took three quick late wickets to leave the hosts with a mountain to climb on the final day's play after being completely outplayed throughout this match.
Liam Plunkett and the impressive Steven Patterson had earlier taken four wickets apiece for the White Rose county as they skittled Middlesex for just 175, with only Gareth Berg (54) offering real resistance.
Captain Chris Rogers then fell for a duck in the first over of the Panthers' second innings - his last knock in first-class cricket for Middlesex before leaving on Australia duty.
And Angus Fraser's side's chances of maintaining their unbeaten record in the Championship this season took a severe blow as Rashid collected the wickets of Sam Robson, Joe Denly and Adam London in quick succession.
John Simpson (20 not out) and Neil Dexter (25 not out) saw the hosts to the close, but Yorkshire start the final day as heavy favourites.