Hampshire looked set for a first-innings lead in excess of 200 after Pakistani seamer Abbas ripped through the visitors with a textbook showcase of line and length bowling, finishing with figures of 6-45.
But Ajeet Singh Dale and Jared Warner added 55 for the last wicket to reduce the deficit to innings deficit to 163 in Hampshire's favour.
It was another Pakistani seamer who then took centre stage for Gloucestershire, as Mohammad Amir finished day two with three for 11, with Ryan Higgins also pilfering a scalp, to leave Hampshire 28-4 with a lead of 191 at stumps.
To start the day, Liam Dawson and South African Kyle Abbott had failed to reach the bonus-point target of 350 - despite a spirited morning effort - with Graeme van Buuren pinning Abbott LBW and Dawson flailing to deep extra cover, as Hampshire were all out for 342.
Abbas came into his own with an incredible seven-over spell of 4-16. Hampshire were now in the box seat and relentlessly hunted down further wickets.
Abbas’ spell initiated murmurs in the Hampshire dressing room that it had produced more heat than other efforts in recent weeks due to compatriots Amir and Naseem Shah watching on.
Marcus Harris ended the procession to Abbas by loosely driving Abbott to second slip and Tom Lace had his off-stump left lopsided by James Fuller.
Ryan Higgins countered with an entertaining 46 before taking on Felix Organ one too many times to top edge to deep mid-wicket. Abbas then completed his five-wicket haul with a short-ball into Goodman’s ribs, which was gloved through to keeper Brown.
Amir followed two balls later with a sharp edge to second slip – Abbas celebrating by running down to his friend and laying his hands on his shoulder in a consolidatory manner.
The hosts might have been debating whether to enforce the follow-on or not prior to Dale and Warner's last-wicket stand of 55 – the highest partnership of the innings.
But their resistance would eventually be broken when Organ got Warner to push to short leg to bowl Gloucestershire out for 179.
Gloucestershire’s glee was increased as, in 11 evening overs, Amir had Organ jabbing to the cordon second ball, before Ian Holland fell in the following over – caught behind attempting to leave Higgins.
Nightwatchman duo of Abbott and Abbas fell LBW in successive balls to Amir, as Hampshire saw their openers and tail disappear in a little over 45 minutes of havoc.