Matteo Berrettini held his nerve to beat Richard Gasquet in sudden death in their semi-final match at the UTS.