A plan covering five years is a five-year plan, not a five-years plan (but check with a Brit on this)
A brush for the teeth is a toothbrush, not a teethbrush.
A tree bearing apples is an apple tree, not an apples tree
And a noun that is only part of a modifying phrase behaves the same way: a girl who's three years old is a three-year-old girl, not a three-years-old girl. (BTW, the grammatical head of this modifying phrase is "old," not "year.")