Ngidi had to leave the ground after bowling just four overs in Bangladesh's innings and Proteas team doctor Mohammed Moosajee revealed he won't be back for up to 10 days.
That rules him out of the all-important clash against India on Wednesday.
"Ngidi sustained sharp discomfort in his left hamstring. We decided he had a hamstring strain. He will be out for week to 10 days," Moosajee told reporters.
"He will have a scan tomorrow (Monday). We hope he can be ready for the West Indies match."
However, there was better news on veteran Hashim Amla, who missed the contest against Bangladesh after being rattled on the helmet by Jofra Archer.
"The concussion assessments were done on Thursday and initially the results were inconclusive. Then the next test showed he could bat," Moosajee said.
"Subsequent to the match, the next day he felt some symptoms, so as a precaution we decided to rest him for this game.
"The plan is to have him ready for the game against India in Southampton."