Generic elements in Zariski-dense subgroups and isospectral locally symmetric spaces