Ainslie overcame a tough start to Finn class proceedings to win a fourth successive gold medal, which saw him replace Denmark's legendary Paul Elvstrom as the Games' most decorated sailor ever.
The 35-year-old's gold was the Host Nation's only one on home waters, while Australia's three-gold haul saw them top the medal table.
Men's 470 pair Mathew Belcher and Malcolm Page then took gold on the penultimate day of racing, which was enough to see Australia end Britain's Sailing dominance of the past three Games - although the British still won more medals than any other nation.
'When it was presented to us in various times in the lead-up it almost made us a bit sick because it's not what we're about,' said Australia Sailing team's High Performance Director Peter Conde.
If you think back to Sydney in 2000 the Brits came and rained on our parade as sailors and was the top nation. So I think it's fitting that we returned serve here.Peter Conde
'But having said all of that, at the end of the day, it's nice. If you think back to Sydney in 2000 the Brits came and rained on our parade as sailors and were the top nation.
'So I think it's fitting that we returned serve here.'
In the women's 470 class, Jo Aleh and Olivia Powrie secured New Zealand yachting's first non-boardsailing gold since 1984, while Xu Lijia of China finished top of the women's Laser Radial standings after a four-way tussle for glory in the medal race.