Saif Ullah called the terrified woman a “white s**t” during an attack described by a judge as “degrading and humiliating”.
Ullah had clocked the 22-year-old victim alone near his flat in Glasgow’s Dennistoun, left his home and started talking to her on September 25 2021.
The 38-year-old went on to force himself on the young woman in a basement at the tenement before she escaped his clutches.
Ullah was sentenced at the High Court in Glasgow.
He had earlier been convicted of charges of rape and attempting to pervert the course of justice.
Judge Douglas Brown told Ullah: “You did not know the woman and were a stranger to her.
“She was clearly vulnerable being alone and intoxicated in the early hours of the morning.
“There was a degree of planning in committing this offence.
“You heard her in the street where you lived and went out to approach her.”
The court heard there had been nothing to suggest in Ullah’s past that he had posed a danger.
But, Judge Brown added: “The author (of a pre-sentencing report) highlighted your behaviour was unpredictable, violent and unexplained.
“She concluded that you clearly present a risk to the public.”
As such, Ullah will be monitored for a further three years on his release.
Jurors heard how Ullah had approached his victim, invited her to his flat and went on to give her a “strong” whisky.
The woman believed they were then going to a communal garden – but instead he lead her a basement area.
The court was told of graphic details of what he then did.
This also included Ullah throwing his petrified victim to the ground, pinching her nose as well as grabbing her head and hair.
She begged to leave, but the attacker refused to let her go.
He was said to have “deliberately degraded and humiliated” her.
Judge Brown noted the nature of the attack meant it likely the affect on the woman will be “particularly marked”.
Ullah was also put on the sex offenders list indefinitely.