For a long time, it did not look like being enough, especially with Jason Roy in an obdurate, destructive frame of mind, but Ngidi prevented England from scoring the seven they needed from the final over
East London: South Africa (177-8) beat England (176-9) by 1 run
England could not make the most of an excellent innings from Jason Roy as Lungi Ngidi's superb final over helped South Africa to dramatic victory in East London.
Roy made the second quickest T20I half-century for England, off 22 balls, as the visitors chased target of 178 at Buffalo Park.
South Africa had threatened to hand Eoin Morgan's side a much stiffer challenge, with 105 on the board from 10 overs, but England's spinners rallied before tight bowling at the death limited the Proteas to 177 for 8.
For a long time, it did not look like being enough, especially with Roy in an obdurate, destructive frame of mind.
The Surrey batsman made 70 - mostly taking the aerial route down the ground - but when he top-edged a slow bouncer from Beuran Hendricks to fine leg with the score on 132, the balance of the match began to shift.
Hendricks, Ngidi and Andile Phehlukwayo mixed their speeds and lengths cleverly at the death and, even with Eoin Morgan making 52 and leaving his side needing seven from the final over, England could not get home.
That was largely down to Ngidi, who dismissed Tom Curran and Moeen Ali to ensure a one-run success.
Eoin Morgan watched his England side start the game slowly
South Africa shot out of the blocks, making the most of a disjointed England performance in the field during the powerplay, as Temba Bavuma and Quinton de Kock put on 48 for the first wicket.
Despite the loss of De Kock, caught in the ring trying to slog sweep Moeen, the Proteas returned their best powerplay score in a T20 international since the 2016 World Cup - 68 for 1 - and passed 100 in 10 overs.
Rassie van der Dussen successfully overturned an lbw decision for Adil Rashid but ultimately perished when he hooked Ben Stokes to Jonny Bairstow in the deep, while Bavuma was caught by Moeen off Rashid to leave the hosts 113 for 3 and in danger of wobbling.
David Miller and Jon Jon Smuts made sure that would not be the case, however, adding 23 for the fourth wicket before Miller was well caught by Chris Jordan, watching the ball into his hands over his shoulder while running back at mid-on.
The home side finished with 177 for 8 - a score with which they would undoubtedly have been happy before the innings began, but somewhat disappointed with given their halfway position.
That was largely down to the excellent of Mark Wood and Jordan at the death, who restricted South Africa to just eight runs from the final two overs. Earlier, Moeen and Rashid had been effective, claiming figures of 1-22 and 1-23 in their respective four-over stints.
England looked ominous at the top of the chase, with Jos Buttler sent in to open alongside Roy.
Temba Bavuma in action
The pair added 18 in the first two overs before Buttler miscued an attempted aerial straight drive off Dale Steyn and succeeded only in flopping a catch to Miller at mid-off.
Jonny Bairstow joined Roy and played the supporting role as his partner cut loose against the left-arm spin of Smuts, taking 22 in a single over including a giant six which clattered into the commentary box over long on.
Roy raced to England's second fastest half-century in T20 internationals, as the visitors began to look like they would race away with the match.
When Bairstow was pinned lbw on the back foot by Phehlukwayo, however, the Proteas had a way back into the game.
Roy departed with the score at 132, Joe Denly followed soon after and Ben Stokes never got going, leaving England needing 23 from the final two overs of the match.
Back-to-back boundaries from Morgan, followed by a sliced six over cover off Hendricks, briefly settled the nerves, only for the skipper to hole out to long on with seven needed.
Curran then went, clubbing Ngidi into the legside - the ball getting caught in the strong gusts which blew across Buffalo Park throughout - before Moeen missed the next ball, leaving England needing five from three.
That soon became three from two, but Ngidi bowled Moeen via the inside edge with the penultimate delivery of the match.
Adil Rashid could only manage one from the last ball, and victory was South Africa's.
Moeen Ali celebrates a wicket