Midfielder Steve Gregory scored twice to earn Hayes & Yeading a place in next season's Blue Square Premier.
After Scott Fitzgerald's opener at The Beveree was wiped out by Shaun McAuley's second-half leveller, the game hinged on four dramatic minutes.
Ian Hodges put Hampton & Richmond in front for the first time on 69 minutes.
But Gregory levelled two minutes later and soon afterwards hit the winner to clinch the Blue Square South play-off final and seal promotion.
Hampton & Richmond had finished higher in the Blue Square South table, second, ahead of fourth-placed Hayes & Yeading.
That earned Alan Devonshire's Beavers, who have never been in the top flight of non-league football in their 88-year history, home advantage for the final at The Beveree.
But Hayes & Yeading had overturned a first-leg 4-2 defeat to win 4-0 at Eastleigh and go through 6-4 on aggregate in the semis.
And Garry Haylock's men again found their away form when it mattered.
Bookmark with:
What are these?