Anthony Stokes had given Hibernian the lead in the 46th minute, but the hosts regained their authority and substitute Gary Wood scrambled the ball home from close range for an equaliser with 20 minutes left.
And in the 90th minute Boyd headed home from Richard Brittain's corner to send the home crowd into raptures.
County had made a bright start but the first chance fell to Hibernian when Colin Nish released David Wotherspoon on the halfway line, however he was tracked back by Scott Morrison and Michael McGovern was quick off his line to gather.
A slack back-pass from Steven Thicot then put Hibs goalkeeper Graeme Smith in difficulties and his attempted clearance was charged down by Andy Barrowman, but the ball went behind for a goal kick.
The home side were seeing a lot of the ball and Michael Gardyne tried his luck from outside the box but his shot cleared the bar.
It was suddenly all County and another fast-flowing move involving Gardyne and Morrison concluded with the ball being crossed for Barrowman who scooped his shot just past the upright.
Hibernian were the stronger side at the start of the second half and made their breakthrough after Riordan's shot was blocked by Gary Miller before going for a corner.
Riordan's flag-kick was knocked back across goal by Nish, and Stokes nodded the loose ball into the net from a yard out for the opener.
The Edinburgh side got a real boost from the goal and looked a different side, and Stokes was not far away with a delicate chip from outside the penalty area which went narrowly wide.
County tried to hit back and an inswinging cross from Paul Lawson was met by Barrowman but his looping header went the wrong side of the post.
Hibernian broke away on the hour mark and Stokes burst into the County box, but Alex Keddie got in a timely tackle just before the former Sunderland player was about to shoot.
Lawson limped off in the in the 63rd minute to be replaced by Wood, a striker for a midfielder as County went for broke. The move paid off when Wood tucked the ball home amid a crowd of players.
Wotherspoon's shot at goal in the 72nd minute was then smothered by McGovern, preserving the equality. The Hibs player would have been better passing to either Nish or Riordan, both of whom were in a better position.
But County were dominating and Iain Vigurs tried a long-range effort which fizzled past Smith's right post.
Vigurs was only inches away with another ferocious shot which curled past the near post at the last minute.
The Hibs defence opened up in the 82nd minute when Wood ran on to a long ball from Keddie, but after Smith blocked the first effort, Craig's rebound was deflected wide.
In a stunning final twist, First Division County won a corner on the right and Brittain's delivery was met at the back post by Boyd who powered the ball home, to set up a Hampden clash with the Hoops next month.