Panesar, playing his first test since 2009, removed Mohammad Hafeez (22), Younis Khan (1) and captain Misbah-ul-Haq (12) before Pakistan overhauled England's meaningful first-innings lead of 70.
Pakistan hopes of challenging England in the last innings rest on little-known Azhar Ali and Asad Shafiq, who will resume on 46 and 35 respectively.
Earlier Stuart Broad hit an unbeaten 58 as England were bowled out for 327. Pakistan scored 257 in their first innings.