Ben Scarborough opened the scoring for the hosts in the 11th minute before Dan Orsi fired home a leveller three minutes later.
A Mark McConnell own goal handed the Anvils the lead before the break.
However, former Gretna man Alfie Robinson popped up with a header in the 87th minute to salvage a point for The Borderers.
Speaking after the match, Gretna manager Vinnie Parker said: “It was a huge point on the road, especially in the Lowland League where it’s tough to travel away.
“It was a battle, and I’m really proud of the boys. I thought they dug in and worked really hard.
“It’s a bit disappointing to lose a goal in the manner that we did in the last minutes. But we’ve defended our box brilliantly all season.
“It’s a point gained definitely.”
He added: “We’ve sold out the supporters’ bus which was huge. Hopefully we can keep it going and give the fans something to shout about (come the end of the season).”
This Saturday the Black and Whites travel to Broxburn before making trips to Cowdenbeath, Tranent, Linlithgow and Hearts B throughout the rest of the month and into March.
Gretna will not return to Raydale Park for a competitive fixture until April 5 when they welcome Civil Service Strollers.
Parker said: “It’s not ideal, we’d like to be at home. I don’t know why it’s such a stretch of away games we’ve got coming up, but we need to deal with it.
“Our away form has been decent, to be fair. We travel well.
“Broxburn are a decent outfit. They’re really hard to break down.
“We need to go back to being hard to beat. It’ll be about trying to keep the back door shut and getting something on the road again.”