JAXA's Hayabusa came to within 44 meters of 25143 Itokawa, which, in an unfortunate sequence of events, lead to its lander MINERVA to miss the target:
MINERVA was deployed on 12 November 2005. The lander release command
was sent from Earth, but before the command could arrive, Hayabusa's
altimeter measured its distance from Itokawa to be 44 m (144 ft) and
thus started an automatic altitude keeping sequence. As a result, when
the MINERVA release command arrived, MINERVA was released while the
probe was ascending and at a higher altitude than intended, so that it
escaped Itokawa's gravitational pull and tumbled into space.
It is possible that MINERVA itself came closer to Itokawa than 44 meters, but it was an unpowered mini lander, so that probably doesn't count:

MINERVA lander (in yellow circle) missing the asteroid 25143 Itokawa as seen by Hayabusa probe. Image: JAXA
Perhaps also interesting (tho it doesn't fit requirements of your question), a week later and as a result of a separate set of approach maneuvers, Hayabusa also landed on the asteroid, collected samples, and then took off again. Next probe to perform a similar feat of briefly touching an asteroid to collect samples will be NASA's OSIRIS-REx at 101955 Bennu.