And the title-holders managed their first win of the season without left-arm seamer, David Willey, who suffered an abdominal strain while bowling in the first innings on Sunday, and will be out for up to six weeks.
The game appeared to be slipping away from Yorkshire in mid-afternoon when skipper Andrew Gale was forced to hobble off the field after earlier being struck a fierce blow just above the knee while fielding at short-leg to Kumar Sangakkara.
Sangakkara and Steven Davies were then going well in a century partnership for the third wicket but when Joe Root took over the reins the game suddenly swung in Yorkshire’s favour.
Root joined the attack himself at the Football End and soon made the vital breakthrough as Sangakkara drove him to Gary Ballance at cover and was out for 61.
In the next over from Jack Brooks, Jason Roy was caught at short midwicket by Adil Rashid and Root picked up another prize wicket when he trapped Davies lbw for 52 to reduce Surrey to 151 for five.
One run later, James Burke was lbw to Brooks and at tea the visitors were struggling on 161 for six, still trailing by 66.
It became much gloomier soon after tea and shortly after the floodlights went on light rain brought about an interruption which caused four overs to be lost.
Ben Foakes and Tom Curran began to worry Yorkshire by settling comfortably into a seventh-wicket stand which lasted 16 overs but Root’s decision to bring back the sparingly-used Steven Patterson worked a charm as he bowled Curran with his first ball.
Surrey skipper Gareth Batty bagged a pair, being caught behind aiming a pull at Patterson, who struck again in the final hour by bowling Foakes for 21.
That made Surrey 205 for nine and Patterson had figures of 8-4-15-3 at that stage, but as the last pair of Ravi Rampaul and Matthew Dunn held out stubbornly, Yorkshire were beginning to run out of overs.
Only five remained when an inspired Root called on Plunkett again and he ended the match with his first ball by dismissing Dunn lbw.
After the previous day’s washout, the field had dried out sufficiently for an 11.45am start and Yorkshire promptly declared on their overnight score of 557 for six which gave them a first-innings lead of 227 and 84 overs at that stage in which to bowl Surrey out.
Rory Burns and Arun Harinath went inside the first 10 overs but Sangakkara and Davies began to build up the pressure until Root’s dramatic intervention.
Yorkshire: Lees, Lyth, Ballance, Root, Bairstow, Gale (capt), Rashid, Plunkett, Willey, Patterson, Brooks.
Surrey: Burns, Harinath, Sangakkara, Davies, Roy, Burke, Foakes, Curran, Batty (capt), Rampaul, Dunn.