Lewis Gregory took his first five-wicket haul in three years to restrict Hampshire, despite fifties to Nick Gubbins, Jake Lehmann and Ben Brown