An injury-time defensive calamity hands Dundee a place in the last 16 of the Scottish Cup, with Drey Wright's simple finish extending nine-man Kilmarnock's winless run to 16 matches.