Les Bleus were 1-0 down at home to Bosnia and heading for the play-offs until Nasri won and scored a penalty 12 minutes from time.
Nasri, who spent three seasons at Arsenal after Wenger paid Marseille £13million for him in 2008, insisted his old manager's advice proved crucial.
He said: "I thought of Arsene Wenger's words when I picked up the ball.
"He told me last season, 'You can take revenge in person if someone fouls you'.
"Some people say you should not take a penalty if you are the player who has been brought down. But he said that's bulls**t.
"And it worked perfectly for me."