Latham was 42 not out, while Raval was on 25 when bad light forced the players off with 3.3 overs of play remaining.
South Africa had been dismissed for 314 about 30 minutes after tea following an almost two-hour rain delay that washed out virtually all of the middle session.
Quinton de Kock had again proved his value to South Africa's lineup with his ability to score quickly and marshall the lower order as they scored 124 runs for the final four wickets.
The wicketkeeper top-scored with 90, falling short of a century for his second successive innings after he made 91 in the second test in Wellington.
He had hit 11 fours and two sixes in his 118-ball stay before left-armer Neil Wagner got a ball to swing in and then straighten off the pitch and trap him in front. De Kock failed to overturn the leg before decision on review.
Kagiso Rabada was the last man out as he scored a career-best 34 with six boundaries a six.
Prior to the rearguard action, New Zealand had been well-placed to dismiss the visitors for not much more than 200 when they managed to remove the overnight pair of Temba Bavuma for 29 and Faf du Plessis for 53 that left South Africa at 190 for six.
Bavuma had attempted to hook a slow, short Matt Henry delivery and only succeeded in getting a nick to first slip Raval, while Du Plessis fell to a brilliant catch by Latham just after reaching his 12th test half century.
The skipper set himself for a lap sweep against left arm-spinner Mitchell Santner but Latham, fielding at forward short leg, moved swiftly to his right and plucked the ball out of the air.
Henry finished with career-best figures of 4-93.
South Africa hold a 1-0 lead in the three-match series having won the second game in Wellington by eight wickets.
The first test in Dunedin ended in a draw with the entire final day washed out.