The champions were beaten for the first time in the County Championship this season after suffering a dramatic collapse on the final afternoon.
Yorkshire tumbled from 92-2 to 134 all-out as wickets fell in a heap after lunch.
It was only the fourth defeat the club have suffered in 62 Championship matches under first team coach Jason Gillespie, and only the fourth in 64 games in total dating back to August 2011.
Yorkshire resumed on 78-2 after lunch, with Alex Lees on 41 and Andrew Gale 17, having been set 381 to win from a minimum of 96 overs.
But any hopes of an unlikely victory were quickly put to bed as Middlesex tore through the visitors’ line-up.
After Lees went to fifty from 104 balls with eight fours, Gale was third out with the score on 92 when he was lbw to Neil Dexter for 17.
It ended a stand of 62 in 24 overs with Lees, who was fourth out at 106 when he was caught at second slip by Dawid Malan off Toby Roland-Jones.
Lees batted well for 62, made from 129 balls with eight fours.
Yorkshire then lost four wickets in 13 balls in the face of some excellent bowling.
Jack Leaning was caught at first slip by Sam Robson off Roland-Jones for four, Andrew Hodd then going first ball when he was caught behind off Roland-Jones.
Tim Bresnan drove at a delivery from James Harris and was caught behind for nine, and the visitors fell to 115-8 when James Middlebrook was caught at second slip by Malan off Roland-Jones for nought.
Yorkshire slipped to 117-9 when Jack Brooks was caught at third slip by Stevie Eskinazi to give Roland-Jones his fifth wicket, the bowler having recorded his maiden century before Middlesex declared on their overnight 573-8.
Tim Murtagh rounded it off when he bowled Steve Patterson for nine.