Gloucester win in amazing finale