National League North side City claimed the lead after just two minutes, Alex Kempster forcing the ball home.
The shaky start from the visitors continued as the hosts struck the woodwork through a powerful 18-yard shot from Dan Maguire on 11 minutes.
Boro started to get into the game as the first half progressed but it was Kempster who came close to adding a second goal on 26 minutes, drilling his shot narrowly wide, just a minute after Tommy Taylor had saved a Maguire shot.
Just before the half-hour mark a good run by City's Nathan Dyer ended with a shot blocked by Danny Lowe,the follow-up cross nearly found Maguire in the danger-zone but Boro managed to clear.
Seven minutes before half-time Taylor tipped over a powerful angled drive from Dyer shot, and two minutes later the Boro gloveman got down well to save a Kieran Green effort.
Boro made the ideal start to the second half, James Walshaw levelling in the 49th minute, the striker tapping home from six yards after fine work from former York forward Michael Coulson to send the 258 away fans, in a crowd of 1,055, into raptures.
Two minutes later Coulson almost put the visitors in front, brilliantly skipping past three home defenders in the box, his low shot hitting the post and bouncing into the arms of keeper Ryan Whitley, and soon after Chris Dawson, on as a half-time sub, fired a shot narrowly wide of the City goal.
Despite this spell of pressure, City regained the lead on 69 minutes through a cracking 25-yard strike from Green.
Dawson fired wide from 30 yards in the 90th minute, but it was the home side who edged to a narrow 2-1 win against their BetVictor Premier Division visitors.