County looked down and out as Hearts led 1-0 thanks to a Callum Paterson goal midway through the first half after the home side had dominated.
Despite County's ascendancy, they did not look like they were going to find the net until a dramatic finish.
The hosts started well. Ivan Sproule was almost through on goal in the fourth minute after Steven Ross picked him out with a cross-field pass but Kevin McHattie stuck out a foot to stop the former Hibs winger in his tracks.
Brittain had the first real effort on goal in the ninth minute when he tried his luck from range but his effort flew wide of Jamie MacDonald's right-hand post.
It was mostly County and an in-swinging free kick from Graham Carey found the head of Scott Boyd but the defender's effort flew well over.
Ross was next up with a turn and shot which flashed wide of the upright and the home side had claims for a penalty turned down in the 19th minute when Brad McKay and Ross tangled in the box.
Despite all the pressure it was Hearts who took the lead in the 23rd minute when McHattie whipped a ball into the box and Paterson tucked the ball past Mark Brown from six yards.
County were almost caught out again in the 32nd minute when Paterson raced on to a long through-ball but his attempt at goal was well wide of target.
But most of the action was at the other end and a burst of pace from Sproule saw the winger get behind the Hearts defence but his low drive into the danger area was cleared before a team-mate could take advantage.
The home side continued to look for a leveller before the break and in first-half stoppage-time Brittain lofted a free-kick from his own half and, after a scramble in the box, the ball fell for Ross but his shot was charged down and the chance was lost.
It was the same story at the start of the second half with County well on top.
Ross had the goal in his sights in the 55th minute but his effort on goal flew high and wide.
Despite being on the back foot Hearts created a really good chance just after the hour mark.
Jason Holt got to the byline and his cut-back was slightly behind Paterson who could only deflect the ball wide of Brown's left-hand post.
De Leeuw and Gary Glen were thrown into the mix in an attempt to spruce things up for County.
Just when it looked as if County had run out of ideas they grabbed a late leveller.
Brittain swung over a deep cross from the right touchline and sub De Leeuw headed in at the back post.
It got better for County in the second minute of stoppage time when the roles were reversed.
De Leeuw fired over a cross from the left and Brittain headed powerfully into the net for the winner.
- Sports & Recreation
- Melvin De Leeuw
- Richard Brittain
- Ivan Sproule
- Callum Paterson