It was Middlesex's fifth Championship win of the season and their third in the last four matches, this latest success moving them up to fifth in the table.
Thanks to Sachin Tendulkar, who made an unbeaten 77 on a pitch which helped spinners, Yorkshire were able to build on an overnight lead of 72 and dictate the terms of their declaration.
This left Middlesex chasing 231 in 46 overs and the game was finely poised at tea when they were two down for 38. Mike Gatting (48) and Ramprakash, though, added 97 in 18 overs and next came a decisive stand of 93, also in 18 overs, between Ramprakash and Paul Weekes, another who made 48.
Wayne Larkins, meanwhile, did his considerable bit for Durham by scoring a brilliant 140 to save the day against Glamorgan at Hartlepool. Durham, however, took only four points from the match and slipped further behind at the foot of the table.
At Bristol, Wasim Akram cut down Gloucestershire for a second time to take his tour haul of wickets to 82. He picked up 6 for 32, Gloucestershire plunging to a defeat by 292 runs and the Pakistanis heading off for Nottingham on a high note.Reuse content