It is most likely what you suspect - stretch of a muscle at the neck. During so called "whiplash
injuries" to the neck (when you have sudden acceleration-deceleration), some muscle can be strained. One of the muscles participating in respiration is attached to the back of the head (to the nape). This is most probably the one that has been pulled.
You basically require more rest, some over the counter pain killers and some time to get rid of this pain. On the other hand, if this pain persists for more than 10 days, I would advise you to see your general practitioner.
hope this helps.