Shane Sutherland shot over the bar for Elgin before Gunn twice directed the ball past the right post.
Henderson gave Berwick the lead in the 36th minute, scoring from the centre of the penalty area after Kyle Wilkie's assist.
Gunn found his form in the second half, and the veteran striker dragged Elgin back into the match after 51 minutes when his shot found the bottom right corner.
He added a second six minutes later, this time directing the ball into the top right corner from close range.
Gunn completed his hat trick in the 68th minute, poaching another goal from inside the six-yard box, but Henderson pulled a goal back for Berwick with a shot into the bottom left corner.
Berwick's comeback was complete in the 84th minute as Gold hit the back of the net from 12 yards.
The result sees Elgin move to three points behind the playoff places, while Berwick remain in eighth.