Derbyshire took six Gloucestershire wickets, but a half-century from Benny Howell (58) in a measured chase saw the visitors win the final Specsavers County Championship match of the season by two wickets.
Lockie Ferguson finished with four wickets and Matt Critchley claimed two in as many overs, but Gloucestershire batted well to achieve their target of 179 with two wickets to spare.
With clear skies and limited seam movement, Derbyshire toiled throughout the opening session for two wickets as Miles Hammond (39) and Benny Howell (58) edged Gloucestershire in front.
Tony Palladino ended George Drissell’s 15-over resistance and the nightwatchman was lbw for 16, but opener Hammond and the experienced Howell added 41 for the fourth wicket in 12 overs.
Viljoen removed Hammond to break the partnership and the visitors went into lunch on 115-4, chasing a further 64 runs after lunch.
Matt Critchley came into the attack after the interval and helped spin Derbyshire back into the match with two wickets in back-to-back overs, first Howell well-caught by Alex Hughes and then Ben Charlesworth (23) lbw to a turning delivery.
Ferguson found a burst of extra pace and bounce and Ryan Higgins (5) was hurried in a pull show, top-edging a return catch to the bowler to leave Gloucestershire seven down still with 21 runs to win.
With three wickets for 16 runs, Derbyshire were in the ascendancy, but the Gloucestershire tail continued to pick up vital boundaries and even as Jack Taylor (16) was caught by the diving Billy Godleman for Ferguson’s fourth, the visitors remained in control.
Gloucestershire required ten to win with two wickets in hand, and Craig Miles relieved the pressure with two fours to take the visitors to victory.
Thank you for your support this season. Club Membership for 2019 will go on sale in October. We hope to see you at The 3aaa County Ground next summer.
Derby’s biggest and best fireworks display, hosted by Capital Breakfast’s Dino, Pete and Tyles, returns to The 3aaa County Ground on Saturday 3 November. Buy your tickets in advance and save.