The first chance for Hornchurch came in the 17th minute as Michael Spence found space on the edge of the Grays area, but his shot was high over the bar.
Hornchurch again came close in the 20th minute as Martin Tuohy played in Alex Bentley down the left and his curling shot went narrowly passed the far post.
Grays responded with a chance of their own in the 23rd minute as good work in midfield lead to a through ball to Jared Small who set Danny Bunce on the edge of the area but his first time shot went narrowly over the bar.
For the remainder of the half, both teams traded corners but could not create any clear cut opportunities to take the lead.
The second half began much the same as the first, with neither side able to create a clear opportunity, aside from in the 49th minute when a ball into the area fell to Martin Tuohy six yards from goal but his snap shot went high over the bar.
The deadlock was broken just after the hour mark as Craig Pope won the ball in midfield before crossing into the area where Jared Small reacted quickest to fire low into the far corner.
The lead only lasted forty seconds however as straight from the kick off the ball was not dealt with in the Grays defence and Lewis Smith stole in between two defenders to slot calmly into the far corner of the net.
Hornchurch came close to taking the lead in the 73rd minute as a long ball up field was only headed into the path of Martin Tuohy on the edge of the area but his volley was straight at Lamar Johnson who saved comfortably.
With fifteen minutes remaining, Danny Bunce was replaced with Joe Sweeney.
However, shortly after Hornchurch took the lead as a long ball forward found Chris Bourne who played in Lewis Smith down the right and he drove into the area and fired into the far corner of the net.
Grays made two late changes replaced Jared Small and Jack West with Brian Moses and Daniel Subuola respectively.
Grays thought they had grabbed a late equaliser in injury time as the ball was played into the area before being knocked down into the path of Brian Moses who fired home, but the assistant referee had already flagged for offside.
Hornchurch held on for the win but Grays can be heartened by the fact they pushed a team from two leagues above all the way to the end.
Grays Athletic: Lamar Johnson, Craig Pope, Junior Baker, Ryan Kirby, Lee Flynn, Danny Bunce (Joe Sweeney 76), Kenny Beaney, Leon Lalite, Joao Carlos, Jack West (Daniel Subuola 82), Jared Small (Brian Moses 82)
Unused Subs: George Kamurasi, David East