Katusha rider Spilak was part of a 17-man breakaway group that formed early on, but all except Spilak were reeled in as the 184km stage wore on.
The winner was thrilled to have hung on.
"It's been a really hard stage with the heat and I don't like the heat at all. Only with 500 metres to go I've believed I could win the stage," he said.
"At one point the chasing group was one minute behind but I wasn't sure. When I attacked in the first climb, I was far from thinking that I'd win the stage.
"Initially, I only followed the attacks. This is an incredible week for Team Katusha after Yuri Trofimov's win yesterday."
Adam Yates and Wilco Kelderman broke out of the peloton to try and catch Spilak in the final 5km, falling short but earning second and third place respectively, 14 seconds behind the winner and three seconds ahead of the main chasing pack.
Team Sky's Froome was part of that chasing pack alongside his nearest rival Alberto Contador, whose attempt to break away was undone by good work from Richie Porte and Mikel Nieve.
“Sometimes, days don't look so hard on paper and turn out to being very hard. That's what happened today when Contador went up the road and put us under pressure, “ Froome said.
“But I asked my teammates to stay calm. They have done such a massive job today. All of them did well and Richie Porte stepped up really well.
"Personally I'm feeling pretty good on the bike. I'm tired after the race but everyone is today. We also had to chase Kelderman at the end because anyone up there on GC is a rival to us. But it's going to be another race on Saturday in the big mountains.”
Contador is 12 seconds behind Froome in the general classification, with Kelderman alongside him in second place on the same time.
Stage five results
1. Simon Spilak (Slo) Team Katusha 4:51:24
2. Wilco Kelderman (Ned) Belkin Pro Cycling 0:00:14
3. Adam Yates (GB) Orica-GreenEdge 0:00:14
4. Daryl Impey (SAfrica) Orica GreenEdge 0:00:17
5. Romain Bardet (Fra) Ag2r-La Mondiale "
6. Daniel Moreno (Esp) Team Katusha "
7. Tanel Kangert (Est) Astana "
8. Damiano Caruso (Ita) Cannondale "
9. Arthur Vichot (Fra) FDJ.fr "
10. Leopold Konig (Cze) NetApp-Endura "
GC standings after stage five
1. Chris Froome (GB) Team Sky 19:01:00
2. Alberto Contador Velasco (Spa) Team Tinkoff-Saxo +12"
3. Wilco Kelderman (Ned) Belkin Pro Cycling Team +12"
4. Andrew Talansky (USA) Garmin-Sharp +33"
5. Jurgen Van Den Broeck (Bel) Lotto-Belisol +35"
6. Vincenzo Nibali (Ita) Astana Pro Team +50"
7. Haimar Zubeldla (Spa) Trek Factory Racing +1:22
8. Jakob Fuglsang (Den) Astana +1:22
9. Adam Yates (GB) Orica GreenEdge +1:24
10. Tanel Kangert (Est) Astana +1:35
- Sports & Recreation
- Alberto Contador
- Wilco Kelderman