At the break, Pakistan was 213 for eight, with Yasir Shah unbeaten on 61 and Mohammed on 1 not out, still trailing Australia by 376 runs. Starc has 6-50 in the innings.
Starc, who had taken four of the six wickets which fell late Saturday in the day-night test, had Babar caught behind and Shaheen Afridi (0) LBW in consecutive deliveries in his 19th over. Mohammad Abbas' leading edge went safely through the point fielders to prevent the world's leading wicket-taker in pink ball tests his hat-trick.
It was Starc's first five-wicket haul against Pakistan and 12th overall in tests.
Babar, who scored a century in the first test at Brisbane, was again the thorn in Australia's side as he batted confidently in the first session before he edged a wide ball off Starc through to wicketkeeper Tim Paine when on 97 from 132 balls with 11 boundaries.
On Saturday, David Warner put Australia in command when he produced the biggest innings ever in the day-night test cricket format and surpassed some of Don Bradman's records before finishing unbeaten on 335 when Australia captain Tim Paine declared at 589-3.
To add to the batting heroics for Australia, Warner also shared a 361-run stand with Marnus Labuschagne (162), a record for Australia against Pakistan, and had partnerships of 121 with Steve Smith (36) and 99 with Matthew Wade, who finished unbeaten on 38 from 40 balls.
Australia won the first test in Brisbane by an innings and five runs.