A free kick from the right was played into the box and following a scramble in the middle of the area, the ball broke to Baff Addae who fired low into the net.
Grays slow start continued and Thamesmead almost doubled their lead in the 7th minute. A long kick by keeper Robert Budd was allowed to bounce by the Grays defence and Rob Carter reacted quickest to get in front of his defender and through on goal, however his header was weak and straight at Lamar Johnson.
The away side registered their first effort on goal in the 10th minute as Joao Carlos played through Daniel Subuola on the left. His pass inside was to Jake Hall who flicked the ball towards goal but the shot was straight at Robert Budd.
Grays were forced into an early change in the 14th minute as David East suffered a badly bruised hip and concussion following a collision with Stuart Zanone.
Both sides struggled to create chances and a neutral would have wondered how exactly the sides were first and second in the league.
Shortly after the half hour mark, Grays came close to an equaliser as Joao Carlos crossed from the left to Kris Newby but his volley was high over the bar.
Grays again came close to levelling the match in the 41st minute as Kris Newby played in Joao Carlos through the middle. He drove into the area and fired low but Robert Budd saved well for a corner which came to nothing.
As the game went into first half injury time, Grays were given a chance to level in the match as Joao Carlos was adjudged to have been fouled in the area, but Jack West’s tame penalty was saved low down by Robert Budd to maintain Thamesmead’s lead into the break.
Jared Small was introduced in place of Daniel Subuola to inject some pace and movement upfront and it wasn’t long before Grays were level.
In the 56th minute, Joao Carlos played Jared Small through on goal down the centre. His shot was well saved by Robert Budd but the rebound fell kindly to Jared Small who tapped calmly into the net.
Grays were awarded a free kick just outside the area shortly after the hour mark as Kenny Beaney was fouled. Kris Newby stepped up to unleash a powerful strike toward the corner of the net, but Robert Budd at full stretch did well to push the ball away.
Kris Newby made way for Joe Sweeney in the 82nd minute as Grays continued to search for the record breaking goal.
It appeared that chance had come and gone in the 86th minute as Lee Flynn fired in a cross from the left before Jared Small flicked on to Joe Sweeney at the back post. The ball sat up nicely for him, but with the goal gaping, his volley went high over the bar.
Grays were not to be denied in what is proving a historic season for the club and the winning goal was worthy of any record.
Fantastic link up play down the left wing between Lee Flynn, Kenney Beaney, Leon Lalite and Joe Sweeney saw the ball reach Joao Carlos just inside the left corner of the area. He took one touch to set himself before rifling a vicious strike across goal and into the far corner of the net.
As the game went into injury time, Lewis Tozer still found time to receive a straight red card after he was adjudged to have stamped on Jake Hall as they challenged for the ball.
Grays saw out the final few seconds to secure the win, their seventeenth, and a 108 year Ryman League record, surpassing the sixteen wins by Farnborough set in 2000/01.
Grays Athletic: Lamar Johnson, Craig Pope, Junior Baker, David East (Ryan Kirby 14), Lee Flynn, Kris Newby (Joe Sweeney 82), Kenny Beaney, Leon Lalite, Joao Carlos, Jack West, Daniel Subuola (Jared Small 46)
Unused Subs: Danny Bunce, Luke Marshall