Bart - English is quite keen on nouns in apposition. Do you do Latin ? In Latin, these would take the same case
five minute walk, and five storey building are both phrases and the nouns are in apposition.
five minutes' walk = walk of five minutes, and minutes' is a genitive plural, and remember the apostrophe at the end of the word
These are different constructions, same meaning.
what was your question - well you can put one of the other.
One of the English tests I took, asked us to distinguish 'long stem rose' and 'long stemmed rose.' Ans: first phrase doesnt exist. I thought this was quite difficult for non-English speakers.