Tharanga's first century had come against Bangladesh in March 2006, and his 110 not out on Sunday allowed Sri Lanka to amass 537 all out on the second day in Harare.
Having dropped seven catches in the field, and seen three dubious umpiring calls go against them, Zimbabwe managed to rouse themselves with the bat and go to stumps on 88 for one.
While opener Brian Chari fell in Rangana Herath's first over, Tino Mawoyo reached the close unbeaten on 41, while Hamilton Masakadza was 33 not out.
Tharanga had not played a Test in more than a year and was not picked in Sri Lanka's initial squad, but made the most of his opportunity when it came along.
"I came into the side after a year out because Angelo (Mathews) and Dinesh (Chandimal) were ruled out, so it gave me a good chance," said Tharanga.
"The pitch was a bit slow and low, but when I got to the middle we were in a good situation so there was no pressure and I was able to play my normal game."
The first day had seen Kusal Perera cash in on two dropped catches to score 110, and Tharanga enjoyed similar fortune on the second day.
The 31-year-old resumed on 13 with Sri Lanka on 317 for four, and earned a reprieve on 66 when he chipped a delivery from Donald Tiripano to short midwicket, where Mawoyo put down the chance.
On top of Zimbabwe's charity in the field, Sri Lanka benefited from three questionable decisions in which umpires Simon Fry and Ian Gould turned down appeals for lbw that replays suggested should have been given out.
With the Decision Review System not in use, Zimbabwe were unable to refer the decisions to the third umpire.
All-rounder Asela Gunaratne marked his Test debut by scoring 54 in a 99-run stand for the sixth wicket with Tharanga, but Zimbabwe stuck to their task and managed to bowl an opposition out for the first time in three matches.
The hosts looked shaky with the bat when Herath introduced himself in just the sixth over and dismissed Chari, but Masakadza got through a nervy start to share an unbroken 67-run stand with Mawoyo.
"We've had two long days in the sun, and I think to come out and be as positive as we were was good," Mawoyo said.
"(Suranga) Lakmal swung the ball away, and as you know Rangana is a world-class bowler and he came in and kept it simple, so it was tough going. I think we can be relatively happy at the end of the day."