McSweeney built an unbroken stand of 131 with James Sale (78 not out) in the second division encounter at Northampton's County Ground.
Middlesex had been finished off for 341, nine short of a third batting point, but had their opponents wobbling at 4-98.
Up stepped McSweeney, who hit 14 boundaries, to come together with rising star Sales and swing the momentum back. The hosts closed the day on 4-229.
McSweeney is in his first season with Northamptonshire, playing under Aussie coach Darren Lehmann, who presented him with his Test cap in 2024.
Division One pace-setters Somerset came up against stubborn resistance from Hampshire.
The early leaders lost seven wickets for 113 as they were bowled out for 288, then saw a lead of 50 evaporate in Hampshire's second innings.
Hampshire reached 1-146 to lead by 96 at stumps with Nick Gubbins unbeaten on 70.
At Edgbaston, Essex and Warwickshire were vying for control of a nip-and-tuck contest. The Bears were bowled out for 190 following their day one travails, with Sam Hain left high and dry on 88 not out.
Essex then reached 110 for three, with Ethan Bamber striking twice.
Back in Division Two, ball continued to dominate at Bristol, where 23 wickets have fallen in two days of Gloucestershire's clash with Lancashire.
The Red Rose were looking dominant at 2-140 in reply to 136 all out, but ended up folding for 240 as Matt Taylor took career-best figures of six for 43.
Lancashire replied with three breakthroughs in eight overs after the turnaround, including an 18th of the season for the evergreen James Anderson. Gloucestershire will resume on 3-58, trailing by 46.