Birmingham had made almost all the running and wasted numerous chances to build on a fifth-minute lead given to them by Kyogo Furuhashi following good work by Demarai Gray.
But Hamer’s introduction off the bench early in the second half breathed fresh life into the Blades and he stunned the home crowd with a quite magnificent drive from 50 yards.
The midfielder picked up a loose ball in midfield before stepping forward and taking aim, sending a shot beyond home debutant James Beadle who had strayed marginally off his line.
Blues boss Chris Davies was upset with referee Gavin Ward on the touchline as the ball hit the match official, who he felt should have blown up for a dropped ball before Hamer produced his moment of magic.
However, those complaints were rendered irrelevant when, after a period of pressure, Stansfield twisted and turned inside the area, firing off a shot which was diverted past Adam Davies by a slight touch from a covering defender.