Isla Bryson attacked two women in Clydebank and Glasgow in 2016 and 2019 while known as Adam Graham.
The judge said Bryson posed a high risk of reoffending and would be supervised for three years after release.
The case sparked a heated debate over whether Bryson should be housed in a male or a female prison after transitioning from a man to a woman.
Bryson, 31, was initially remanded to a women's jail after being found guilty, but was then moved to a men's facility.
This followed concerns about the safety of any women held alongside a transgender sex offender in a female jail.
The case ultimately led to an urgent review and a change in policy which will see all newly-convicted or remanded transgender prisoners initially placed in jails according to their birth sex.
The trial heard that Bryson, from Clydebank, had preyed on vulnerable women online.
Passing sentence, Lord Scott told Bryson: "You see yourself as the victim in this case. But you are not."
The judge said reports suggested Bryson had a set of neuro-developmental disorders.
"Your vulnerability is no excuse at all for what you did to these two women in 2016 and 2019," he said.
"Regardless of your own vulnerability, in a period of just under three years, you raped two women who can both be regarded as vulnerable."
Lord Scott said Bryson had preyed on victims because of their vulnerability and raped them in their own homes.
He added that the rapist - who continues to deny committing the offences - would be placed on the sex offenders register for life.
Bryson's estranged wife, Shonna Graham, said the focus should be on the victims.
"The way I see it is he is a man, he done the crime as a man… he should do the time in a man's jail," she said.
Ms Graham said she had met Adam Bryson in 2015 and they married the following year.
The 31-year-old said there had never been any suggestion during their relationship that her husband wanted to become a woman.
She said she believed Bryson had hoped to serve the sentence in a woman's jail and have an easier time - but that this had not worked.
"You can't do a crime as a man then want to transition once you've been charged with it. That's how you know it's all a big joke to him."
Ms Graham alleged that Bryson had attempted to rape her and stabbed her while they were together.
She was also angry that the person she knew as Adam Bryson had then used the name Adam Graham.
"He took my last name so he could get away with his crimes, the way I see it," she added.
"I hope he rots in jail. I hope the victims can put this evil person behind them."
In court, defence advocate Edward Targowski KC said Bryson had been subjected to "ill-judged, ill-informed and ignorant" comments about the decision to undergo gender reassignment.
Mr Targowski said his client had decided to change gender many years ago, had received "maximum" amounts of medication, and was on a NHS waiting list for a gender reassignment operation.
A review into the case was ordered by Justice Secretary Keith Brown and its key findings were made public earlier this month, although the full report was not published on grounds it contained personal information.
It showed that the Scottish Prison Service had made the decision to divert Bryson to Cornton Vale women's prison in Stirling, rather than the planned destination of HMP Barlinnie in Glasgow, while the offender was in transit.
Two days later, senior management decided "due to the level of risk and remaining uncertainties" to move the inmate to a male prison, HMP Edinburgh.
First Minister Nicola Sturgeon told the Scottish Parliament that Bryson would not be incarcerated in Cornton Vale "either short-term or long-term".
Asked about the case on Tuesday, SNP leadership candidate Humza Yousaf said: "Isla Bryson is deceptive, manipulative, trying to get advantage of the system.
"I hope they're incarcerated and will be incarcerated in a male prison."
Scottish Conservative MSP Russell Findlay said Bryson could be back on the streets in as little as four years, which would be "little comfort to victims".
Bryson made the decision to transition from a man to a woman while awaiting trial.
It is thought to be the first time a trans woman has been convicted of raping women in Scotland.
There are relatively few trans prisoners in Scotland.
The latest Scottish Prison Service statistics said there were 12 trans women and three trans men between October and December 2022. There were 7,019 male prisoners and 265 female inmates.
The Scottish government has stressed that the case is not connected to the Gender Recognition Reform Bill, which has not yet been enacted and was blocked from becoming law by the UK government.