They were in trouble at 68-5 in reply to the home side's 238 all out, but Lawrence (123 not out) and captain Ryan ten Doeschate (86) rebuilt the innings.
The pair put on 125 for the sixth wicket and then Lawrence added another 130 with James Foster, who made 54.
The visitors were 368-8 for stumps, leading by 130 runs.
Leicestershire's Dieter Klein (4-84) dismissed Nick Browne and Tom Westley before lunch, adding to the scalp of England Test captain Alastair Cook on day one, but Essex's lower-order put them on top at the halfway point.
An unbeaten century by teenager Dan Lawrence put Division Two leaders Essex in a strong position on day two against Leicestershire at Grace Road.