Yes, the number is how many of the needle could fit in a particular circle. It comes from measuring wire. The same system is used with medical needles and body piercing jewellery. Because it's a pre-metric system, it doesn't necessarily relate to a familiar measurement now - a sewing needle size 28 is much bigger than a 28 gauge medical syringe needle!
no subject
https://en.wikipedia.org/wiki/Wire_gauge
This is an explanation of how the system came to be.