Joe Marchant scored twice in the second half as Harlequins overcame a 17-point deficit at half-time to beat Gloucester 28-24.