Gregory and team-mate Josh Davey took three wickets each.
Already Division One of the County Championship would be down to a two-horse race if Essex had beaten Somerset. Essex would have had three victories, the county champions Surrey two, and every other county without a victory.
The all-rounder is confident his local knowledge and coolness under pressure can help England retain their title in the Caribbean