New South Wales Police told the media that the traveller, who has not been named, fought off her alleged attacker by grabbing a knife and stabbing him after he had sexually assaulted her.
She is now in hospital and was expected to undergo surgery on Wednesday.
A 27-year-old man has been charged with grievous bodily harm with intent to murder, and aggravated sexual assault.
The man - who is a Mexican national - was refused bail during a court hearing and will appear at Sydney’s Central Local Court on May 5, reports BBC News.
He is currently being held in hospital under guard, authorities have said.