Ireland, following on, were 123 for four at lunch on the fourth day -- still 57 runs adrift of Pakistan's total of 310 for nine declared.
After collapsing to 130 all out in their first innings, Ireland resumed on a highly creditable 64 without loss.
But they lost four wickets in Monday's first session, with left-arm quick Amir -- who had both openers dropped during a brief spell on Sunday before going off with a knee problem -- enjoying a burst of two wickets for no runs in six balls.
It was a heartening sign for Pakistan, both in terms of winning this match and ahead of their upcoming two- Test series in England that will feature back-to-back fixtures at Lord's (May 24-28) and Headingley (June 1-5).
Amir, however, repeatedly limped around the field on Monday when he was not bowling.
At that stage they were still 116 runs behind.
Joyce played a ball from Rahat Ali onto the legside and set off for a needlessly tight single before failing to beat Faheem Ashraf's direct hit from midwicket.
The 39-year-old left-hander was out for 43, including six well-struck fours.
There was always the fear that as soon as Ireland lost one wicket, another might follow soon afterwards and so it proved as 69 for one became 69 for two, with Andrew Balbirnie lbw to Mohammad Abbas for nought for the second time in the match.
Amir did not come into the attack until Monday's ninth over but it did not take him too long to get back among the wickets.
He struck with his 29th ball of the day when he bowled Niall O'Brien (18) -- a wicket greeted with his usual arms out wide celebration. And 94 for three became 95 for four when Amir had Porterfield (32) edging to wicket-keeper Sarfraz Ahmed, the Pakistan captain.
At lunch, Amir had innings figures of two for 12 in 10.2 overs.
Paul Stirling was 10 not out and Kevin O'Brien, who top-scored with 40 in Ireland's first innings, unbeaten on 18.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)