South African Kyle Abbott picked up 4-84 as Hampshire frustrated Derbyshire's attempts to build a sizeable first-innings advantage on day three at the 3aaa County Ground.
The hosts had hoped to establish a commanding position as they resumed following a morning washout at 203 for two, in response to Hampshire's first innings of 328.
But Abbott had other ideas, using the second new ball to excellent effect as Derbyshire slumped from 273 for two to 312 for seven before a timely, unbeaten 56 from Tim Groenewald ultimately helped the hosts to a total of 399.
Early signs had been better for Derbyshire once play finally got under way after a morning washout, with Stephen Moore adding a further 22 to his overnight total before falling to a Sean Ervine catch off Abbott on 128.
Overnight partner Shivarine Chanderpaul departed three overs later, caught by Ervine off James Tomlinson for 82, and Abbott would claim the further wickets of Richard Johnson, Wes Durston and Tony Palladino.
But Groenewald, who had had the honour of taking the first hat-trick of the new season against Essex two weeks ago, proved equally adept with the bat to swing the momentum back the visitors' way.
Groenewald finally ran out of partners when Mark Footitt fell lbw to Liam Dawson for no score, giving the hosts a first innings advantage of 71.
Hampshire responded by making a solid start to their second innings, Michael Carberry and Jimmy Adams unbeaten on 11 and five respectively as the hosts finished the day on 20 for no wicket, a deficit of 51 runs.