Northamptonshire 219 and 372 for 7 (Whiteman 114*, Gay 85*, Procter 63) lead Middlesex 277 (Higgins 64*, Stoneman 51, Keogh 3-52) by 314 runs
Sam Whiteman and Luke Procter shared Northamptonshire's highest partnership of the season to give their side hope of forcing a crucial LV= Insurance County Championship win against fellow strugglers Middlesex at Merchant Taylors' School.
Whiteman batted most of the day for his majestic knock of 114 on a pitch that showed signs of flattening out, adding 158 with his captain for the third wicket after Emilio Gay had limped off injured.
However, the opener later returned to the middle, scoring a valuable unbeaten 85 that enabled the visitors to set another record by posting 372 for seven, their highest red-ball total of the summer and an overall lead of 314.
With an overnight declaration likely and both sides - who occupy the relegation places in Division One - desperate for victory, it sets up an enthralling final day.
Northamptonshire resumed their second innings just three runs behind the home side and wiped out that deficit when Gay flicked Ryan Higgins to long leg in the second over of the morning.
Minutes later, however, the opener was hobbling off in the direction of the dressing room, having pulled up after completing a single and Procter took his place at the crease.
The skipper registered his side's first boundary of the day, clipping opposite number Toby Roland-Jones neatly to the rope as both he and Whiteman proceeded to take advantage of wayward deliveries on the leg side.
Apart from one wild thrash outside off stump by Whiteman against Tom Helm, there were no alarms for either of the pair as they extended their side's lead to 51 before rain arrived around 12.30pm.
With lunch taken early, only 20 minutes were lost and, soon after the resumption it looked as though Helm had fashioned a breakthrough when an apparent leg-glance by Whiteman, on 29, flew into John Simpson's gloves.
But umpire Paul Pollard remained unmoved by Middlesex's impassioned appeal and the Australian continued to make steady progress as he brought up his half-century, pulling Ethan Bamber to the fence at square leg.
The home side rotated their bowlers - including eight overs of Sam Robson's occasional leg-spin - without success and Whiteman's edge through the slips off Roland-Jones for four lifted the partnership into three figures.
Another downpour later in the over triggered a further delay at 161 for two but, once the players re-emerged, Procter completed a watchful half-century, his second of the campaign, from 135 deliveries.
Middlesex took the new ball at the earliest opportunity, reverting to an all-seam approach and they finally claimed the day's first wicket in the 63rd over when Procter cut uppishly at Helm and Josh de Caires, at deep third, judged the catch perfectly.
Gay, who restarted his innings on 24, appeared to be unhampered by his earlier injury and promptly pumped two leg-side fours off Higgins before dancing down the track to slam De Caires for six.
Whiteman advanced to his hundred from 220 balls, driving Helm off the back foot for three as Northamptonshire began to accelerate and he eventually lost his off stump to Roland-Jones, attempting to pull.
Saif Zaib soon followed, caught at point after miscuing a reverse sweep off De Caires, who also collected the wicket of Tom Taylor before a brisk knock of 48 by Rob Keogh helped Gay to propel the total beyond 350.