As far as I know dry needling causes the muscles to contract. This squeezes the acids out of the muscles causing a better blood flow afterwards. So as far as I know this is almost the same as a massage but more localized.
But as with a massage, if the cause of the knot in the muscle it not taken away the effect will only be temporarily (couple of days maybe).