Meanwhile, Lyon earned a second win from two matches, 2-1 at Rennes. Nice, which travels to Napoli next week in the Champions League playoffs, enjoyed longs spells of domination but lacked efficiency against a well-organized team that was clinical.
The visitors went ahead against the run of the play through Adama Niane in the 54th minute. Alassane Plea leveled for Nice 10 minutes later. Troyes midfielder Saif-Eddine Khaoui snatched three points for the visitors with a strike from the edge of the area with four minutes left.
Playing without stars Mario Balotelli and Wesley Sneijder, Nice had the upper hand during an entertaining first half. Lucien Favre's players monopolized the ball and camped in the visitors' half. Nice played fast, passing football. The best chance came after 10 minutes when midfielder Bassem Srarfi passed three defenders with fine dribbles only to miss the target by inches.
Troyes was dangerous on the break with one-touch moves. Niane made the most of a misunderstanding between Nice captain Dante and goalkeeper Yoan Cardinale to put the visitors ahead. Dante looked like he was able to prevent Niane from getting to the ball first but Cardinale came out of goal and hit the defender as Niane managed to poke the ball over.
Nice pushed hard for an equalizer and was awarded a penalty 10 minutes later after defender Oswaldo Vizcarrondo fouled Pierre Lees-Melou in the box. Plea converted from the spot with a well-taken shot into the bottom left corner.
The game looked set for a draw but Nice's defense was made to pay for its passivity in the closing moments. Niane got the better of his marker to collect a cross into the box, set up Khaoui with a back pass and the midfielder slotted home with a fine effort.
DIAZ SCORES AGAIN AS LYON STAYS PERFECT If there were still some doubts about the quality of new striker Mariano Diaz among Lyon' fans, they should vanish completely. The former Real Madrid player, who was brought in this offseason as a replacement for Alexandre Lacazette, scored again for Lyon.
Diaz, who started his French league career with a brace last weekend in a 4-0 thrashing of Strasbourg, made it 2-0 in the 75th minute with a header from Nabil Fekir's assist. Memphis Depay had put the league leader ahead in the 58th with a curled free kick.
Diaz, who left Madrid to get more playing time, scored only once goal for the Spanish club but was highly praised by coach Zinedine Zidane, who recommended him to Lyon president Jean-Michel Aulas. Benjamin Bourigeaud pulled one back for the hosts with four minutes left.