The veteran left-arm seamer took three of the last four wickets to fall as the home side, chasing 262 to win, crashed from 231 for six to 258 all out.
Adam Hose and Steve Davies hit half-centuries as Somerset battled to record their first Championship win of the season. But Sidebottom’s guile and some suicidal shots from the late order batsmen meant another day of frustration for Matthew Maynard’s team
Yorkshire’s fielders raced around the outfield in elation when the last wicket fell. They took 20 points to Somerset’s four from a memorable game that continually swung to and fro.
Starting the day of 101 for four, requiring a further 161, Somerset reached lunch on 205 for six, thanks largely to their two overnight batsmen.
Hose and Davies batted comfortably through the first hour against mainly seam bowling. Both were watchful and advanced the total slowly at first.
Hose went to his maiden Championship half-century off 103 balls, with 5 fours and a six, showing commendable maturity in a pressure situation on his debut in the competition.
Davies then brought up his first fifty since joining Somerset from Surrey during the winter. The experienced left-hander had faced 109 deliveries and struck 6 fours.
The stand was worth 118 in 39 overs when Hose lost concentration and drove a wide, flighted ball from Karl Carver in the air to Peter Handscomb at short cover.
Lewis Gregory has been in good form with the bat lately and was soon on the attack, launching two boundaries off successive Adam Lyth deliveries.
He and Craig Overton, celebrating his call-up to England’s T20 squad, were unbeaten at lunch, with 57 still needed, Overton having struck a straight six off Lyth.
The afternoon session saw Overton smack his second six, this time depositing a Carver long-hop over wide long-on.
With 40 needed, Yorkshire skipper Gary Ballance recalled Ryan Sidebottom into the attack and it proved a match-winning decision. His first over back saw Overton edge to third-man for four.
The second saw Gregory, on 26, chase a wide one and drive a catch to cover where Carver took the ball with both hands above his head. The stand with Overton had added 42 in 13.5 overs, but 31 more runs were still needed.
Overton was joined by twin brother Jamie. Both are naturally aggressive batsmen, but the situation called for cool heads.
Craig played and missed twice in Sidebottom’s last over, persuading the wily left-armer not to take the new ball when it became due.
It proved a good decision as Craig chanced his arm once too often, driving at a wide one and nicking a catch behind to give Sidebottom his second wicket.
Jack Leach edged Lyth just short of second slip as the tension grew. Then Sidebottom struck again as Leach swung across a full length ball and departed lbw for a single.
With 12 needed, Jamie Overton hit Lyth for six and two before chipping the off-spinner to mid-wicket where Carver took the catch to spark wild Yorkshire celebrations.