Visitors Derbyshire needed 14 off the last over, bowled by England quick Stephen Harmison.
Botha, 26, who has played first-class cricket in South Africa for Easterns and KwaZulu-Natal, slogged the first ball straight for four, lofted the next over Harmison's head for two then turned a yorker behind square for a single.
That left Botha's fellow left-hander Kevin Dean on strike. Dean turned the fourth ball of the over to fine-leg for four and scramble a single off Harmison's next delivery.
Derbyshire were left needing one off the last ball to tie the scores and win by virtue of having lost fewer wickets.
But Botha, who also holds a British passport, settled the matter by flipping a yorker behind square for four as the field closed in to try to save the single.
Botha's fourth boundary left him 34 not out off 26 balls.
In the other game held over from Wednesday, Worcestershire thrashed Scotland by 10 wickets at the Grange, the visitors winning with more than 30 overs to spare.