The visitors started the second half brightly. Rennes were awarded a free kick after Fabrice N'Sakala fouled Kevin Theophile-Catherine. Romain Alessandrini stepped up with a stunning free kick to bring Rennes back into the match.
Julien Feret leveled the score inside the last 10 minutes to give Rennes hope of a win.
The resurgent visitors pressed for a winning goal, until Jonathan Pitroipa struck from outside the box to complete a stunning comeback.
The defeat leaves Troyes in the relegation places, eight points from safety.