Earlier, four wickets each from Mohammad Abbas and HasanAli restricted the hosts to 184.
Meanwhile the recalled Hasan, who did not play in Pakistan's win over Test debutants Ireland in Dublin concluded last week, took four for 51 in 15.2 overs.
Pakistan then consolidated their strong position by reaching stumps having lost just Imam-ul-Haq to be 50 for one - a deficit of 134 runs.
Cook equalled former Australian captain Allan Border's world record of 153 Test appearances in succession. The last time these two teams played a test series against each other, was back in 2016 in England.
But at 33, Cook is some five years younger than when Border played his 153rd Test, a reflection both of England's heavy programme and the increasingly congested nature of modern worldwide cricket.
Ben Stokes unfurled a few trademark attacking strokes in his 38 but he was trapped lbw by Abbas following a review and England's last five wickets crumbled for the addition of 16 runs straight after tea.
England's total was their lowest in the first innings at Lord's since 2005 and the spotlight invariably fell on England captain Joe Root and his decision to bat first in what proved to be hard conditions.
Meghan Markle's coat of arms for new Duchess of Sussex title revealed
As the grant was made to the Middleton family, the Duchess of Cambridge's siblings are also allowed to use the coat of arms. Thomas Woodcock , who is Garter King of Arms, said: " The Duchess of Sussex took a great interest in the design".
Mark Stoneman's unconvincing global career continued when he was bowled by Abbas for four, beaten as he tried to drive a full-length delivery which clipped the top of his off stump.
Root, promoted up the order to number three, also fell for four when he drove at a wide ball from Hasan and edged behind to opposing captain Sarfraz Ahmed.
Hasan, a skiddy, English-type bowler, took the second of his four wickets in his next over, finding the outside edge of Dawid Malan as Root's decision to bat first in overcast conditions began to look increasing suspect.
Cook, England s all-time leading Test run-scorer, went to fifty with a four to third man off Amir before Bairstow was bowled by Ashraf for 27.
It was the latest memorable Lord's incident for Amir, who got his name on the honours board with six wickets against England at MCC's headquarters in 2010 -- the same match where his involvement in a spot-fixing scandal led to a jail sentence and a five-year ban from cricket.
The innings ended when Amir running back at mid-on, caught Mark Wood.