Josh Giddey led Australia (1-1) with 19 points.
Canada could clinch a quarterfinal berth by the end of Tuesday should France beat Japan and Germany prevail against Brazil.
The seventh-ranked Canadians topped No. 14 Greece 86-79 in their tournament opener while Australia downed Spain 92-80.
Canada faces the No. 2 Spaniards in their group match on Friday at 11:15 a.m. ET.
WATCH | Canada posts 10-point victory over Australia for 2nd Olympic win:
After making a stepback mid-range jumper for Canada's first basket, Gilgeous-Alexander made his way to the bench after picking up a quick second foul just 1:44 into the game.
Despite that, Canada held its own in a back-and-forth opening frame that saw six lead changes and four ties with Australia ahead 28-26 by the end of it.
After Giddey opened the second quarter with a three, Gilgeous-Alexander and Dort led Canada on a 7-0 run to take the lead 2:30 into the frame.
Australia didn't let Canada get too far as a Giddey floater with seven seconds left gave the Aussies a 49-45 edge going into halftime thanks to outscoring Canada 30-16 in the paint over the first two quarters.
Canada went on a 17-5 run in the third quarter to take a 66-56 lead, capped by a pair of Barrett free throws with 3:58 remaining.
Australia returned fire, though, with a 6-0 run capped by a questionable missed call for offensive interference made it a four-point game with 2:59 left in the quarter. An Australian player appeared to touch the ball as it was in the hoop but Canada's challenge was rejected.
Canada held a 72-70 lead after three quarters.
Barrett hit a corner three to make it a 9-2 Canada run with 5:09 remaining that prompted an Australia timeout in the fourth quarter. Jamal Murray followed with a layup almost a minute later to give Canada its largest lead, 83-72.
Canada led by at least seven points the rest of the way, with Brooks capping the scoring with a three-pointer with three seconds left.
WATCH | Canada aims for Olympic gold, not just podium finish:
With files from CBC Sports
It is a priority for CBC to create products that are accessible to all in Canada including with visual, hearing, motor and cognitive challenges.