Bastos sends Lyon temporarily top
Bafetimbi Gomis put the home team in front in the 38th minute before Argentina striker Lisandro Lopez made it 2-0 in the 50th.
Nancy, who scored seven goals in their first two league games of the season, pulled one back through Morocco striker Youssouf Hadji and the visitors were pushing hard for an equaliser when Bastos struck in the 68th minute.
"It was one of my best goals because it was a perfectly balanced shot," said Lyon's new Brazilian striker.
Elsewhere, promoted Montpellier climbed to third place on eight points thanks to a 3-0 win at Nice in a game halted for 20 minutes in the second half when fans threw fireworks on the pitch.
Referee Laurent Duhamel only allowed the match to restart when the spectators involved were ejected from the ground.
Nice ended the game with 10 men after Nigerian central defender Onyekachi Apam received a second yellow card for a late tackle on Lilian Compan nine minutes from time.
Another promoted club, Racing Lens, are on seven points after a 2-2 home draw with Stade Rennes.
Lens defender Marco Ramos and Rennes midfielder Yann M'Vila were sent off.