Harmer took six for 87 as Notts were bowled out for 337 in their second innings, leaving the defending champions requiring 282 for victory.
Kraigg Brathwaite made 68 for the hosts and Steven Mullaney scored 53 before becoming Harmer’s fifth victim.
Vijay, who hasn’t played since making a pair for India in the second Test of the recent series against England, followed up his first innings 56 with an undefeated 73 as Essex closed on 147 for one.
The home county began the day in good shape on 116 for one but lost three wickets, all to Harmer, during the opening session.
Luke Fletcher, the nightwatchman, had an eventful time at the crease. He was struck on the elbow by a wild throw from Nick Browne and also reprieved after being caught off a no-ball from Matt Coles.
Nevertheless, the local favourite, a few days away from his 30th birthday, skilfully frustrated the Essex attack for more than two hours in making 39.
Brathwaite, the West Indies’ opener, reached his third half-century in as many matches for Notts, getting there from 117 balls with his ninth boundary. The opener stroked three more fours before being pinned on the crease by Harmer’s off-spin.
Fletcher’s lengthy vigil ended in the same manner and Jake Libby lost his off stump for 15.
Resuming from their lunchtime score of 208 for four, Notts lost their fifth wicket to an unexpected source. The visitors opened the session with the part-time spin of Tom Westley and the hunch paid off as Ben Duckett fell lbw for 17.
Harmer returned to the attack soon after the second new ball had been taken and bagged three further wickets as Notts lost their momentum.
Tom Moores was stumped for 15, after a stand of 68 with Mullaney, who nicked the spinner into the hands of wicketkeeper Adam Wheater.
The former South African international then had Lyndon James caught by Ryan ten Doeschate at short leg before Jamie Porter removed Samit Patel and Mark Footitt to polish off the innings.
Essex began their pursuit of 282 with the early loss of Browne, playing all around a full-swinging delivery from Footitt.
Vijay and Westley, who is undefeated on 45, negotiated the rest of the final session in adding an unbroken 130 together to put Essex firmly on the way towards their first victory at Trent Bridge since 2003.