Thanks for your question and I don’t think you have anything to be worried about.
You said it was a sewing needle, these are different than needles used to inject drugs because they are not hollow. The reason HIV can be spread when sharing needles to inject drugs is if one person has HIV their blood (and the virus) can be trapped in the hollow needle and the end of the syringe. There is no hollow area for blood to collect in a sewing needle. If someone with HIV did step on this needle before you were poked with it, there would not be enough virus present to cause an infection in you.
You can also consider that HIV can not live outside of the body and so if there was any virus on this needle, it would be dead by the time you were poked and so could not cause an infection.
Let us know if that helps answer your question or if you need more information,
Other people reading, leave a comment below to let us know if this was helpful.