Phil Jaques made a breezy unbeaten 36 from 48 balls and Vikram Solanki (13 not out) struck two early fours in the home side's reply.
Glamorgan resumed their innings at 133 for three but lost six wickets for 56, before Mark Wallace (37) and Andrew Davies (14) put on 49 runs for the final wicket.
For the second successive day, Zaheer was warned for running into the danger area and he responded by taking two more wickets.
Zaheer's first innings figures read 26-10-65-4.
In another Division Two match, Dinesh Mongia (39 not out) proved the fulcrum of the Leicestershire innings as Glamorgan seized early initiative to reduce the opposition to 132 for four in 42.1 overs.
Mongia's unbeaten 39 came off 75 balls and included four hits to the fence.