Dundee suffer late blow against 10-man Hamilton