The Orica-GreenEdge rider narrowly beat Tom-Jelte Slagter (Blanco) in an uphill sprint to win his team's first stage win of 2013.
However Slagter took the overall lead and has a 13-second cushion heading into Sunday's final stage in Adelaide.
A picturesque stage through South Australia's wine country saw several attempted breakaways - the most persistent was led by Javier Moreno (Movistar), who was caught inside the least kilometre when Gerrans and Slagter powered away from the peloton.
Slagter appeared to be in pole position for the win but Gerrans reeled the young Dutchman in.
Gerrans said: “I never gave up until I was right to the line. When the young Blanco guy [Slagter] jumped past us, I had to get on his wheel and come past him on the line. I was second here last year, and I won here today. It’s a nice way to round out the week.
“It was an absolutely fantastic crowd today,” he said. “It was bigger than any Tour de France stage. There were people around the whole course cheering us on. It was a great atmosphere.”
Geraint Thomas (Team Sky) dropped from first to fifth in the general classification. He said: "The legs went with around 500 metres to go.
"The boys did a great ride and then Edvald (Boasson Hagen) did a good turn at the end. I should have just swung over maybe and got someone else to work but I ended up pulling for a bit and I was a bit empty after that. Gerrans came past a bit too fast for me to get on his wheel and I went backwards from there.
- Sports & Recreation