Northants 310 (Levi 101, Hogan 4-58) and 42 for 1 require a further 176 runs to beat Glamorgan 207 (Salter 59, Meschede 49, Gleeson 5-60) and 320 (Cooke 69, Gleeson 3-71, Kleinveldt 3-77)
Northamptonshire need another 176 runs on the final day with nine wickets in hand to claim a potentially valuable victory over Glamorgan in their bid to win promotion to Specsavers County Championship Division One.
Rory Kleinveldt and Richard Gleeson took three wickets apiece as the visitors, seeking to make up significant ground on top two Nottinghamshire and Worcestershire in Division Two, bowled out Glamorgan for 320 in their second innings at Cardiff.
That left the visitors needing 218 for victory, and they reached 42 for 1 by the close with Ben Duckett the man out for 23.
Rob Newton and nightwatchman Simon Kerrigan will resume on Friday with Northamptonshire knowing only a victory will do.
Earlier, Glamorgan had batted with more application and purpose in their second innings than in the first, especially after losing two quick wickets at the start of the day.
Resuming on 61 for 1, they saw overnight batsmen Jack Murphy and Jacques Rudolph dismissed by Kleinveldt in his first two overs.
Murphy was lbw to Kleinveldt's fifth ball before Rudolph, having moments before been caught off a no-ball, drove Kleinveldt to cover to depart for 28.
That left the hosts on 68 for 3 but Colin Ingram and Kiran Carson rebuilt with a partnership of 68.
Teenager Carlson played some handsome strokes through the off side and had progressed to 44 before he gloved a ball from Azharullah on to his stumps.
Following his dismissal, a heavy shower stopped play with Glamorgan taking an early lunch on 136 for 4.
When play resumed, Ingram became Azharullah's second victim when he had his off stump knocked back, but careful application from Chris Cooke and Andrew Salter saw them put on 71 for the sixth wicket as Glamorgan increased their lead.
The partnership was broken by Rob Keogh, who got his first ball to turn through the gate and bowl Salter for 19.
Cooke, who faced 116 balls and struck nine fours in a watchful innings, top-scored with 69 but his stay came to an end when he was caught by wicketkeeper David Murphy off Kerrigan.
At 244 for 7, Northamptonshire would have hoped to wrap up the Glamorgan tail in quick fashion but Marchant de Lange went on the attack to get the home side past the 300 mark.
He clubbed three sixes and two fours in his 39 - his highest score for Glamorgan - and shared in a stand of 57 in only 9.2 overs with Craig Meschede.
Gleeson ended the fun by dismissing both De Lange and Meschede - either side of Lukas Carey being bowled by Kleinveldt - to leave Northamptonshire needing 218 to win and 12 overs left before the close.
The visitors almost lost a wicket to the seventh ball when De Lange just failed to hold on to a return catch from Duckett, but Glamorgan still managed to snare the dangerous opener just before stumps when Michael Hogan had him caught behind.