Eight minutes in an error at the back handed Shields striker Jason Gilchrist the chance to open the scoring, but he directed his shot straight at Tommy Taylor in the Boro goal.
Boro took the lead after 11 minutes, Michael Coulson latching onto a ball from Jack Johnson before lashing in.
Just a couple of minutes later Boro had a chance to double their lead, but James Walshaw's strike was blocked by a home defender.
Coulson fired in an effort on the Shields goal 10 minutes later that was grabbed at the second attempt by Mariners' gloveman Myles Boney.
Shields ended the first half on the front foot, Taylor being forced into action to deny Nathan Lowe and Craig Baxter before Jordan Hunter fired wide and Nathan Lowe was denied by some heroic last-ditch defending by Isaac Assenso.
The hosts maintained their dominance at the start of the second half proceedings and were soon level when a poor touch from Assenso allowed Gilchrist to fire in from close range for 1-1.
Robert Briggs' free-kick was then directed just over Taylor's bar via a deflection as Shields continued to search for a second.
On 66 minutes Coulson fired just over after good play from Walshaw before substitute Sefton Gonzales headed just off target at the other end.
Poor defending from visitors Boro then handed Gonzales a chance to put the Mariners ahead, but Taylor did well to clear before an outstanding save from Taylor kept out Lowe's close-range header.
With 10 minutes left on the clock Boro were reduced to 10 men, Wayne Brooksby receiving his second yellow card of the clash.
Coulson fired wide of Boney's goal and Connor Thomson saw a tame effort kept out by the Shields keeper as Boro went in search of a winner late on.
In a cruel late twist, Shields were awarded a last-gasp penalty when the referee adjudged Pete Davidson to have felled Gilchrist in the box, and the Mariners striker made no mistake from the spot to hand the BetVictor Northern Premier League table-toppers the three points.
Boro will now switch their attentions to the visit of Stalybridge to the Flamingo Land Stadium on Saturday.