Pakistan recovered from losing five wickets before lunch to post a respectable 282 and then remove two of Australia's openers before close of play on the opening day of the second and final Test in Abu Dhabi on Tuesday.
The tourists were left on 20-2 after seven overs going into the second day.
Off spinner Nathan Lyon took four wickets in six balls to leave Pakistan reeling on 77 for five at lunch.
However, Pakistan were indebted to debutant opener Fakhar Zaman and captain Safraz Ahmed who each scored 94 to help their side reclaim the advantage in the afternoon session.
The hosts, forced to settle for a draw in the first Test in Dubai after a desperate rearguard action from the Australians, won the toss and chose to bat on a wicket that promised a big tally.
The tourists bowled with spirit and pace, however, and Mitchell Starc struck in the fourth over, swinging a rising delivery into the pads of Mohammad Hafeez.
Hafeez slapped it straight to Marnus Labuschagne at short leg and the close fielder juggled the ball off his thigh, knee and calf before it finally settled in his hands to send the batsman on his way with a single boundary to his name.
Azhar Ali (15) and Haris Sohail (0) were removed on consecutive deliveries by Lyon to conclude one over, and although Asad Shafiq fended off the hat-trick ball, he too went for a duck after a DRS review.
The fourth wicket, two balls later, was the pick of the quartet, with Babar Azam bowled for nought after wafting an ill-advised shot at a perfectly pitched delivery to leave Pakistan teetering on 57-5.
Zaman and Ahmed did more than steady the ship, however, by combining for a partnership of 147 to kill off Australia's momentum.
Zaman was eventually bowled for lbw by Labuschagne, before the leg spinner then got Bilal Asif caught for 12 by Aussie captain Tim Paine.
A lapse in judgment from Ahmed saw him caught by Peter Siddle six runs short of his century as he sliced high to cover for Labuschagne's third wicket of the day.
Yasir Shah (28) and Mohammad Abbas (10) added 38 to Pakistan's total before being bowled by Mitchell Marsh and Starc, respectively, leaving Mir Hamza on 4 not out.
Australia's hopes of chasing down 282 took two blows in quick succession in the last seven overs of the day.
Abbas claimed the prize wicket -- his 50th in Test cricket -- of Pakistani-born Australia opener Usman Khawaja after four overs, having given a slight edge caught by Ahmed.
Abbas then got his 51st Test wicket, removing Siddle for lbw to leave Australia shell-shocked on 20-2 at close of play, with Aaron Finch on 13 not out and Shaun Marsh next to bat.