South Africa claimed the Toyko Sevens title with a thrilling 24-19 victory over New Zealand in the final.