According to authorities, the 23-year-old injured woman in turn grabbed a knife and stabbed the man who had allegedly tried to sexually assault her.
She is now in hospital expected to undergo surgery.
According to BBC News, the alleged attacker, a 27-year-old man from Mexico, is being held in hospital under guard.
Australian police said he had forced his way into the woman’s room to assault her on Tuesday and when she resisted, he later returned with a knife and began stabbing her.
Speaking to the media, detective inspector Despa Fitzgerald said: "Obviously her survival instincts kicked in and she was able to remove herself from the situation.
"It’s just lucky [the weapon] didn’t hit a major artery in those alleged attacks, and for him as well.
"Our understanding is they weren’t well known, they were possibly acquaintances but we’re still trying to work that out."
Sydney Police believe the man had been in Australia for around four weeks.
Following the incident police have made an appeal to travellers to stay safe when sharing accommodation with people they do not know well.