After Suranga Lakmal had grabbed the wicket of overnight batsman Craig Ervine in the eighth over of the day, Herath bowled opener Brian Chari for a career-best 80 and then had Malcolm Waller caught at cover for 18 on the stroke of lunch.
Those dismissals left Zimbabwe struggling on 210 for five in reply to Sri Lanka's 504 all out, with Sean Williams doing his best to resist the tourists on 40 not out.
However Chari and Ervine took Zimbabwe to stumps on a sturdy 126 for two, and made a patient start to the third morning before Lakmal got one to move off the seam and catch the edge of Ervine's bat, removing the left-hander for 64.
Chari batted on and had a maiden Test hundred in his sights when he played around a quicker ball from Herath.
Although Waller made a positive start to his knock, with lunch in sight he pushed at a Herath delivery and found Kaushal Silva in the covers, leaving Zimbabwe trailing by 294 runs with just five wickets in hand and giving Herath figures of 4 for 69.