Playing his second match for Worcestershire, Zaheer earned an early breakthrough for his side by claiming the wicket of England opener Marcus Trescothick for a duck but Somerset overcame the early setback to score 406 and had Worcestershire struggling at 89 for three.
Losing Trescothick's wicket, Somerset looked in a spot of bother but Australian Cameron White (65) and Wes Durston (74) prevented a batting collapse and then Peter Trego and Richard Johnson came up with identical belligerent knocks of 51 as Somerset went past the 400-mark.
Zaheer's bowling figure read 25.1-8-100-4 with Trescothick, Carl Gazzard, Richard Johnson and Charl Willoughby as his victims.
In another division two match, Dinesh Mongia went wicketless with bowl as his side Lecestershire found going tough against Surrey with Mark Ramprakash (113) hitting his fifth century against Leicestershire at Grace Road.
Ramprakash's century came off 203 balls with 14 fours and a six and Surrey were bolostered by half centuries by Mark Butcher (77) and Jonathan Batty (54) as they reached 370 losing all their wickets.
A hit with his gentle left-arm spin, Mongia did not have success and he conceded 23 runs in his three overs.
Leicestershire lost two wickets to crawl to 62 after 17 overs with Mongia (0) and Hylton Ackerman (9) in the crease.