A "despicable" rapist has been brought to justice and jailed for 10 years in part thanks to a woman's testimony from beyond the grave.