It looked as if Grays would have to settle for a draw when Daniel Subuola’s effort was disallowed in the 86th minute but he found the net again a minute later and this time it counted.
Thamesmead strengthened their grip on third place, but not before they were given a scare or two at bottom club Redbridge.
The hosts needed a win to get off the foot of the table and they made a good start with a tenth-minute strike from Jacob Cleaver.
Rob Carter equalised and when Stuart Zanone put Thamesmead ahead shortly before the interval they must have guessed that they would have a comfortable second half against a team with only four home points to their credit.
Far from it. Cleaver made it 2-2 on the hour, his 12th of the season for a side that had only scored 27 at that point, and Richard Butler’s own goal put the Motormen in front again seven minutes later.
Zanone quickly levelled matters again and a last-minute effort by Cory Walters-Wright stole a 4-3 victory for Thamesmead.
Tilbury beat Cheshunt 2-1 at Chadfields despite missing a penalty when it was still scoreless. Jack Carlile broke the deadlock in the 77th minute and Emiel Aiken made it 2-0 in added time, with Lee Brennan replying even later in the day.
Brentwood and Chatham ground out a 0-0 drawn in the only other game played: Waltham Abbey’s home fixture against Needham Market was postponed until Thursday.
Keep up-to-date with our exclusive email newsletters.
Subscribe