Ajmal took seven for 95, as Zimbabwe were bowled out for 327 -- a first innings lead of 78.
Pakistan were 21 for one in their second innings at lunch, still trailing by 57 runs.
Khurram Manzoor was leg before wicket for the second time in the match, padding up to a ball from Tendai Chatara which cut back at him after he had scored five.
Elton Chigumbura became the third Zimbabwe batsmen to score a half- century, making 69 before he was ninth man out, caught off bat and pad at short leg by Azhar Ali after a 129-ball innings which included eight boundaries.
More From This Section
Last man Chatara was out first ball, caught at gully by Younis Khan.
Overnight batsmen Chigumbura and Shingi Masakadza took their eighth wicket stand to 32 before Masakadza went back on his stumps and was leg before wicket to Ajmal for 14.
It was Ajmal's eighth haul of five or more wickets in Tests. His best figures were seven for 55 against England in Dubai in January 2012.