Ntini suffered the injury in the last over before tea but stayed on the field throughout the final session so that South Africa still have the option of using him on Tuesday as they try to level the series.
The match finished evenly poised with Sri Lanka on 262 for five needing to score another 90 runs. Captain Mahela Jayawardene was unbeaten on 77 and wicketkeeper Prasanna Jayawardene was on 27.
''The match is on a knife-edge at the moment and the first hour's play tomorrow morning is going to be very crucial,'' South Africa coach Mickey Arthur told journalists.
''We are eight overs away from the second new ball and we will look to restrict as much as we can before giving the new ball bowlers a second bite of the cherry,'' he added.
''Hopefully, if Makhaya (Ntini) is fit in the morning, he and Dale (Steyn) can do the job with that second new ball.
''Makhaya has a hamstring strain and will be treated through the night -- we will see how he responds.
''The worst case scenario is that we could lose him for six to seven weeks and the best case scenario is that he wins the test match.'' Muttiah Muralitharan, who claimed 12-225 in the match to complete four consecutive 10-wicket hauls, believes Sri Lanka now have the advantage.
''With Mahela still there and two good batsmen still to come we now have a good chance,'' said Muralitharan.
''I feel we have a slight edge but whoever handles the pressure best will win the game,'' he added.
The 34-year-old was delighted with his prolific run after recent ''10-fors'' at Edgbaston, Trent Bridge, Sinhalese Sports Club and now the P. Saravanamuttu Stadium.
''Claiming four consecutive 10-wicket hauls is very special for me as it includes two tests overseas in England,'' said Muralitharan.
Sri Lanka won the first of the two-match series by an innings and 153 runs.