Watch free daily video highlights from every LV= County Championship match here on ecb.co.uk this summer
Northamptonshire looked set to claim their second LV= County Championship Division Two win of the season despite half-centuries from Alex Gidman, Benny Howell and Chris Dent for Gloucestershire at Bristol.
The hosts, trailing by 212 on first innings, were largely indebted to Gidman, Howell and Dent - with 87, 53 and 50 respectively - for guiding them to 280 for nine at stumps, an overall lead of 68.
But the Northamptonshire attack stuck impressively to their task on an easy-paced pitch and there were three wickets apiece for Andrew Hall and Steven Crook as the early-season pacesetters closed on victory.
Gloucestershire started the day on 34 for one and, with no addition to the total, Dan Housego fell to the fifth ball of the morning when he was caught down the leg side by wicketkeeper David Murphy off Trent Copeland.
Gidman and Dent applied themselves well to add 56 in 21 overs, but the latter then attempted to withdraw his bat to a delivery from David Willey and only succeeded in edging on to his stumps.
Hamish Marshall departed five overs later, caught at first slip by Copeland off Hall, and Gloucestershire went into lunch in considerable trouble on 111 for four.
The afternoon session started well for the hosts as Gidman and Howell put on 69 for the fifth wicket with few alarms.
Gidman brought up his 95-ball half-century by cutting Copeland to the cover boundary and the county's former skipper then took three fours in quick succession off Hall.
He also hit off-spinner James Middlebrook for a straight six and appeared on course for a century until he pushed forward to Hall and edged low to Copeland at first slip.
Will Gidman, Alex's younger brother, was dismissed six overs later when he was caught behind off Crook and Gloucestershire took tea on 188 for six, still 24 short of making Northamptonshire bat again.
The visitors only had to wait one over after tea to take the second new ball, but Howell and Cameron Herring successfully saw the shine off it with some attractive strokeplay in a partnership of 54.
Teenage wicketkeeper Herring was dropped on nine by Rob Newton at backward point off Crook, but otherwise played impressively in only his second first-class innings.
Howell progressed to a patient 142-ball half-century, with five fours, before he edged Hall to David Sales at second slip to give the South African his third wicket.
Jack Taylor took successive boundaries off Hall, to midwicket and backward point, on his way to an unbeaten 30 at stumps, but there were still two more wickets for Northamptonshire to celebrate in the closing overs.
Herring chipped Crook to Alex Wakely at midwicket to depart for 32 and the seamer then bowled David Payne for a duck.
Click here for all the latest news from the domestic cricket scene, including exclusive interviews, team news, match reports and photo galleries