Stewart Walters just missed out on posting Glamorgan's first century of the first-class season as the Welsh county ended the third day on 303-6 in Cardiff, giving them a lead of 189 over Essex.
Walters made 98 to follow up his first-innings 67, while captain Mark Wallace struck an unbeaten 61 as Glamorgan set up an intriguing final day to the Division Two clash.
Essex had resumed on Friday morning on 343-9 but their first innings lasted just three more balls, Graham Napier edging Michael Hogan to slip as he finished with career-best figures of 6-70.
Still, they held a useful 114-run lead after both sides had batted once and their position improved even further when David Masters struck with his second ball to remove Ben Wright.
Will Bragg looked in good touch until he went lbw to Ravi Bopara on 42 and before lunch Marcus North had become Master's second victim, leaving the score at 80-3.
Walters and Murray Goodwin combined after the break to wipe out Essex's lead, posting a half-century partnership before rain heralded an early tea.
Essex fought back briefly in the evening session as Glamorgan slumped from to 184-5 with the loss of Goodwin (42) and Allenby.
Glamorgan's lead was out to 120 when slow left-armer Tim Phillips snared the important wicket of Walters, who edged behind, leaving the batsman agonisingly short of a ton.
But Wallace, who reached his first half-century of the season from 90 balls, and Graham Wagg (32 not out) added 69 for the seventh wicket as the hosts reached stumps without any further losses.