Gay, having been dismissed by Mohmmad Abbas on day one while batting for a County Select XI against Pakistan, snicked Mohmmad Ali behind on Friday to fall for a seven-ball duck.
The Durham batter had suffered a shoulder injury playing for his county in the One Day Cup earlier this month but his appearance in this game has probably allayed any fears over his fitness for the first Test at Headingley from next Wednesday, live on Sky Sports.
- Scorecard: County Select XI vs Pakistan, Test warm-up
- Stream England cricket on NOW without a contract
- Joe Root removes England's midnight curfew
Babar, meanwhile, was struck on the right hand by a delivery from young Hampshire seamer Manny Lumsden and retired hurt on five from 17 balls.
A statement from Pakistan later said that the skipper would sit out the remainder of the game as a precautionary measure but that he will participate in the team's practice session in Leeds on Monday.
Babar - whose side also play England at Lord's (from August 27) and Edgbaston (from September 9) - struck one four in Beckenham batting in the No 4 spot.
Pakistan plummeted from 164-2 to 238 all out, in reply to their hosts' initial 305 all out, as they surrendered a 67-run deficit on first innings.
England spinner Shoaib Bashir, hoping to be included in his country's XI at Headingley, bagged figures of 4-76 from 20.2 overs, dismissing opener Imam-ul-Haq (37), middle-order man Salman Ali Agha (14) and then Aamir Jamal (8) and Ghazi Ghori (27).
Abdullah Shafique (61) top-scored for Pakistan, while Lumsden and Northamptonshire's Saif Zaib picked up two wickets apiece for the County Select XI.
England vs Pakistan Test series fixtures
- First Test (Headingley) - Wednesday August 19 - Sunday August 23 (first ball 11am)
- Second Test (Lord's) - Thursday August 27 - Monday August 31 (first ball 11am)
- Third Test (Edgbaston) - Wednesday September 9 - Sunday September 13 (first ball 11am)
Watch the three-Test series between England and Pakistan live on Sky Sports Cricket from August 19. Stream cricket and more sport contract-free with NOW.