In an answer on a Microchip forum, Jan Axelson, author of 'Serial Port Complete', claims a maximum cable length of 10' for the SPI bus. Other posts have mentioned the same figure. So your distance of 5m may or may not work since it is just a little longer.
Another answer on the same forum recommends using 120- ohm terminating resistors on the lines.
There are several recommendations in discussion of this topic that say a big factor is reducing the clock speed, down to as little as 100 kHz. Then look at your signals with an oscilloscope.
One way to increase the distance way beyond your requirements is to use digital isolators and twisted pair drivers as discussed in this article: "Extending the SPI bus for
long-distance communication" It claims a distance of 100m (not a typo).