The hosts were bowled out for 385 with Josh Shaw taking four wickets on debut but Gloucestershire lost two wickets in the first over of their second innings as Jamie Porter (3-53) starred.
Gareth Roderick and Jack Taylor hit half-centuries but the away side were bowled out for 215, a lead of just 92.
Essex reached 34-0 from the remaining nine overs and require 59 runs to win.
An impressive day with the ball helped Essex move to the brink of victory against Gloucestershire at Chelmsford.