A man who raped a teenage girl as she slept after becoming unwell at a party has been jailed for more than five years.