The pacy forward opened the scoring shortly before half-time then put number two on a plate for Mark Beck 10 minutes into the second period to help Simon Weaver's team to a 2-0 victory at the CNG Stadium.
Three points mean that the Wetherby Road outfit cannot finish any lower than seventh position and will now have the chance to compete for a place in the Football League at the end of the regular season.
The opening exchanges of Easter Monday's contest were fairly even, Gateshead's Scott Barrow's effort from distance forcing James Belshaw into a routine save early on before Lloyd Kerry saw two long-range strikes easily held by Aynsley Pears at the other end.
Both sides saw hopeful appeals for a penalty waved away before the visitors started to get on top and Jack Hunter missed a great chance to open the scoring when he nodded wide from just six yards out in the 32nd minute.
The Tynesiders continued to produce the better football, so it was somewhat against the run of play when Town took the lead four minutes before half-time.
Josh Falkingham lifted a through-ball over the Gateshead back-four and Thewlis beat the offside trap, taking the ball around the advancing Pears and rolling into an empty net.
Thewlis was at it again just seconds after the resumption, using his pace to race clean through on goal and past the dive of Pears before falling dramatically to the turf.
Referee Simon Mather was not impressed, however, booking the Town striker for simulation.
Undeterred, Thewlis had a big hand in his side's second goal.
This time, he stayed on his feet as he hurdled a challenge wide on the left before driving into the box, beating another defender and delivering a low cross that Beck couldn't miss at the back post.
Thewlis had the ball in the net for a third time soon afterwards, but was denied a hat-trick by a linesman's flag.
Town saw out the remainder of the match fairly comfortably, though Belshaw was forced to make a couple of from Steve Rigg's header and a cross that looped up off George Thomson and towards the top corner.
Weaver's troops had however already done more than enough, securing their chance of a shot at Wembley ahead of next weekend's final-day trip to Wrexham.