A stiff neck is sometimes caused by tightness in the levator scapulae muscle.
As the name suggests its role is to elevate the scapula. When other muscles that perform a similar task such as rhomboid minor, are unable to contract effectively, it is the levator that sometimes takes up the slack.
You can see how similar their line of pull is below.
Try this simple exercise for a stiff neck.
It will help improve the ability of your rhomboids to contract and you may find that stiff neck will start to loosen.
Lay on your back with your target side arm about 6 inches away from your side. Place a book between your arm and your side around the level of your forearm.
Keeping the shoulder blade flat to the floor, very gently (around 10% of your available strength) squeeze your arm into the book focusing on the area between your spine and your shoulder blade. Hold for 6 seconds and repeat 6 times.
These low load isometrics (muscle contractions without movement) are the most effective way to get muscles working again and to address the underlying cause of muscle tightness, muscle weakness.
For another post on the potential cause of tightness in the muscles of the neck go here.