Sri Lanka were in deep trouble at 50-5 following fast bowler Tim Southee's three-wicket burst in the morning before posting 247 in their first innings in reply to New Zealand's 221.
The tourists reached 35-1 in their second innings at stumps after losing hard-hitting opener Brendon McCullum, caught by Nuwan Kulasekara off left-arm spinner Rangana Herath who was pressed into the attack after three overs.
The match is evenly poised at this stage, with New Zealand nine runs ahead with as many wickets in hand.
Skipper Jayawardene and vice-captain Angelo Mathews (79) earlier propped up the innings with a 156-run stand for the sixth wicket.
The hosts looked like gaining a big lead when they reached 206-5 but lost their last five wickets, including those of well-set Jayawardene and Mathews, for 41 runs.
The tourists, who went wicketless in the afternoon, came back strongly to take five wickets in the last session, with off-spinner Jeetan Patel striking three times to finish with 3-55.
Jayawardene looked set to complete his 32nd Test century when he was caught behind while trying to sweep Patel. He hit one six and 11 fours in his 176-ball knock.
Mathews fell soon after the tea-break, caught by wicket-keeper Kruger van Wyk off seamer James Franklin after hitting one six and 12 fours in his 154-ball knock.
Jayawardene and Mathews defied the tourists' attack for more than a session with their sensible batting, confidently gathering runs against both pace and spin.
Mathews was more aggressive in the second session, smashing a six over deep mid-wicket off Patel and then flicking paceman Doug Bracewell for a four to complete his ninth Test half-century.
The New Zealand fast bowlers exploited the morning conditions well as they took four wickets in the opening hour to put the hosts under pressure, with Southee grabbing three and Trent Boult one.
Southee dismissed Tharanga Paranavitana and nightwatchman Suraj Randiv in his opening two overs before accounting for Thilan Samaraweera, while Boult got a big wicket when he had Kumar Sangakkara (five) caught by McCullum at third slip.
Southee, who took one wicket on Saturday, struck with his fourth delivery in the morning when he bowled Paranavitana for no score. He got the third wicket in his next over, having Randiv caught by Martin Guptill at second slip.
He then trapped Samaraweera (17) leg-before, the batsman offering no stroke to a delivery that came in.