The 2nds, missing regular skipper Alex Watt, were captained by stand-off Alex Ferguson, but made a poor start as the Nails scored two quick tries to race into a 12-0 lead.
Haddington responded as Ferguson kicked a penalty to get the home team on the board.
They began to find their feet in the match, and scored a superb first try as the excellent Ferguson sent Liam Parker through the midfield, with the big centre using his power to go over under the posts.
Ferguson converted to further reduce the gap, and the Reds took the lead when they demolished a Heriot's scrum five metres out, allowing number eight Mark McLoughlin the easy task of dotting down.
The conversion sailed through once more, but Heriot's scored a third try of the half shortly after as the lead chopped and changed throughout an entertaining opening 40 minutes.
Haddington led 20-19 at half-time, but could have been further ahead - Ferguson off-target with a penalty, and the returning Jamie Wilson unable to take an offload from his stand-off.
The visitors were unable to cope with the power of the home pack, which saw Ross Turner, Gordon Cuthill and Jock MacKay introduced in place of Max McAlpine, Gav Harper and Gav Redpath at the break.
MacKay made his mark on the game with a thunderous tackle on the Heriot's centre, who remarkably made it back to his feet after a huge hit - following the lead of Mark Morrison in the first half.
Haddington scored a third try of their own as Kyle Mitchell, returning to the side, burrowed his way over from close range following more good work by the pack.
The Nails, though, were never far behind, and there was to be a dramatic finish to events, as the referee forgot the score!
He insisted the visitors led 25-24, so when Ferguson's last-gasp penalty sailed wide, they believed victory was theirs, only to be denied after the whistler spoke with both team managers, who confirmed Haddington's victory.
The Reds go on to play Jed-Forest on Saturday.
Haddington: Ewan Cunningham, Craig Rafferty, Jamie Wilson, Liam Parker, Jamie Paterson, Alex Ferguson (captain), Alex Peace; Gav Redpath, Robin Mainstone, Alan Bell, Gav Harper, Kyle Mitchell, Mark Morrison, Max McAlpine, Mark McLoughlin