Luis Reece claimed a career-best 7-20 as 17 wickets fell on Day Two to leave Gloucestershire on 29-2, chasing a further 150 runs to win at The 3aaa County Ground.
Alex Hughes hit a defiant 55 not out as Derbyshire set the visitors 179 runs to win, before Lockie Ferguson took two late wickets in search of a fifth Specsavers County Championship win of the season.
Resuming their first innings on 100-5, Matt Taylor showed resistance for his 29, but Derbyshire were able to wrap up the final six Gloucestershire wickets for just 63 runs in the morning session.
The pace pairing of Ferguson and Hardus Viljoen each picked up a wicket, but it was Reece who continued his form from the evening on Day One to wrap up the tail.
He came on as first change from the City End and claimed three more wickets to end the innings with career-best figures of 7-20, the third best bowling analysis for a Derbyshire bowler in the 21st century.
With a first innings lead of 21, Derbyshire lost Billy Godleman (4) before the lunch interval as wickets continued to fall on the challenging pitch.
Reece could only make seven, while Wayne Madsen was again out for 14 and Tom Lace was lbw to Benny Howell for 17.
Hughes was in at four and proved to be a stalwart of the Derbyshire innings, in a typically determined knock which carried Derbyshire to 157 all out.
His unbeaten 55, after coming in with the score 32-3, helped form partnerships worth 34 with Lace, 27 with Anuj Dal (11) and 22 with Viljoen (16).
Set 179 runs to win, Gloucestershire had ten overs to face in the evening session as the fielders cast long shadows on the outfield in the setting sun.
Derbyshire’s defence got off to the perfect start as Ferguson struck with his first delivery, Chris Dent caught behind by Harvey Hosein.
The New Zealand quick struck four overs later and bowled James Bracey for 2 to leave Gloucesterhsire in trouble on 19-2.
Miles Hammond (15 not out) and George Drissell (7 not out) defended well to the close, but Derbyshire will head into Day Three hopeful of defending their total on a pitch which has only seen two batsmen pass 50.
Four-day cricket is back! Derbyshire host their final Specsavers County Championship match of the season against Gloucestershire from Monday 24 September. Buy your tickets in advance and save.