A slow start to the game saw only one attempt in the first ten minutes which came from the away side in the 7th minute as Joel Ettienne-Clark fired narrowly passed the far post from the edge of the area.
Grays managed a couple of corners in the next twenty minutes which was the only threat they could muster in the opening half hour.
Ilford took the lead on 33 minutes as a long kick from Daniel Mbaku in the Ilford goal found Hsama Hamdan who ran through on goal and fired into the roof of the net.
Grays first shot of the match came in the 42nd minute as Jack West swivelled on the edge of the area and shot low towards the corner but Mabku pushed the ball around the post for a corner which came to nothing.
As the halftime whistle went, the home fans voiced their discontent to possibly the worst half of football Grays have played since Hakan Hayrettin took over as manager.
Stern words during the interval by the Grays manager clearly had an effect on the players as they started the second half much better than the first.
Inside the first minute of the half Grays forced a corner which was swung over from the right and found the head of Ryan Kirby two yards out to nod home for his first goal for Grays Athletic.
On the hour mark the home side almost took the lead as a corner from the left was met by the head of Junior Baker but cleared away for another corner. This time the ball was cleared to the edge of the area where Luke Marshall fired towards goal but Tony Dawkins remained alert to clear off the line for another corner. This corner was met by the head of Jack West but was straight at Mbaku was saved easily.
Grays made the customary substitution of replacing Luke Marshall on 63 minutes for Jared Small.
The home side took the lead for the first time in the game on 72 minutes as from their fifteenth corner, Junior Bake rose highest to head low into the far corner much to the relief of the home crowd.
Ilford almost made an immediate reply as Hamdan found space on the edge of the area but fired narrowly passed the right hand post.
A minute late Hamdan came close again as his turn and shot from the edge of the area was saved by George Kamurasi and pushed away for a corner which came to nothing.
Grays saw out the remainder of the game for an unconvincing win, but a win none the less to keep their promotion hopes alive.
Grays Athletic: George Kamurasi, Craig Pope, Junior Baker, Ryan Kirby, Danny Bunce, Luke Marshall (Jared Small 63), Kenny Beaney, Leon Lalite, Joao Carlos, Joe Sweeney, Jack West
Unused Subs: Lee Flynn, David East, Jake Hall, George Smith