SPOILER ALERT: If you haven't read Chapter 657 of the manga, read further at your own risk.
In Chapter 657, the reborn Uchiha Madara asks Sasuke to join his side, remarking that they are the last of the Uchiha. However, he died before the Uchiha clan massacre, and was reincarnated with Edo Tensei only during the fourth World War. He fought with the five Kages, and then headed to the battlefield where Obito was fighting Naruto's team. Obito didn't have a chance to tell him the story of what happened after his death.
How come he knows that Sasuke is the last surviving Uchiha?