Matlock started brightly in front of a home crowd and striker Liam Hughes rattled the bar after three minutes before Callum Dolan saw his one-on-one effort saved by Lewis King.
Rangers responded and almost had themselves an opener on 18 minutes with Joe Cuff capitalising on a mistake before seeing his shot saved by Shaun Rowley.
The Boro went close again on 26 minutes but Matlock just managed to clear their lines during a goalmouth scramble.
After showing his danger in the first half Hughes put his side ahead in the 62nd minute.
Matlock continued to pile pressure on their visitors which eventually paid with substitute Danny Greenfield doubling their advantage.
Despite fellow substitute Kade Coppin being sent off for two fouls on the goalkeeper the hosts held on for victory.