NSW dismissed Victoria for 259 on Saturday to take first innings points after scoring 317 on Friday's opening day.
At stumps on the second day in the four-day game, NSW were in danger of handing back the ascendancy, 23 for two in the second innings, an overall lead of 81 runs.
Languishing in second-last place on the standings, NSW faced an almost impossible task to reach the final if they left Newcastle empty-handed.
The two innings points earned on Saturday kept them in the hunt with 11 points. An outright victory would put them right back in the title reckoning.
MacGill's haul of 5-94 from 31.1 overs, including 29.1 on the trot and 3.1 with the second new ball came as Australian selector Allan Border watched from the grandstand.
MacGill went into the state match criticised for his Test series return against India of 14 wickets at 50.79, and with the return of Shane Warne from a drugs suspension next month.
A screaming catch from Dominic Thornely to dismiss Victorian dangerman Matthew Elliott was another turning point.
Elliott, the former Test opener, peeled off a string of boundaries in the opening session but just when he seemed on the verge of dominating the NSW attack, a full-blooded cut rifled off the middle of his bat from the bowling of medium-pacer Grant Lambert and flew towards Thornely at point. The NSW allrounder hurled himself full-length to his right and the ball stuck.
Waugh fails with bat in Shield game