County looked dangerous on the counter throughout as the pace of Ivan Sproule kept Hearts deep in defence.
The deadlock was broken by Wohlfarth on 21 minutes when the German striker cut inside and unleashed a shot into the top corner from a tight angle.
Hearts needed a pair of smart saves from Michael Fraser to stay in touch, with Sproule guilty of wasteful finishing with two strikes from close range.
Kevin McHattie went close for the home side late on with a surging run and shot from distance, but his side trail at the break after a difficult first half.
The home side were level five minutes into the second half as Michael Ngoo scored his first goal in eight matches with a powerful header.
County reclaimed the lead just four minutes later thanks to Wohlfarth, who headed home unmarked from a corner at the neat post as the Hearts defence were punished for switching off.
Hearts wrapped up the three points shortly after as Ngoo got his second with a powerful drive into the bottom corner.