The Italian led by 50 seconds going into the final week of the race, but wound up on Monday with 22 seconds shaved off that advantage.
Warren Barguil of Argos-Shimano took the stage win - his second in four days - breaking away and resisting a late attack from Rigoberto Uran, but the real drama came behind the pair.
Nibali was dropped by second-placed Chris Horner, third-placed Alejandro Valverde and fourth-placed Joaquim Rodriguez towards the end of the 146-kilometre stage from Graus to Sallent de Gallego.
"It was a very difficult finale. There was some strong headwind," Nibali admitted to reporters.
"I hoped to be better, but it was a steep finish, so that was it. I started to feel a little off in the last 3km."
Nibali will be buoyed by a rest day on Tuesday, with the race resuming on Wednesday.