Did Luffy know who Sogeking is?
Anime Reference:
As you can watch in this scene, it's not that Luffy finds out that Sogeking is actually Usopp. It's just that he introduces himself as:

Luffy and Chopper: Sogeking from the Sniper Island?
Sogeking (Usopp) : That's right! I'm one of Usopp's close friends. I'm here to help you out on your journey.

Manga Reference:

Hence, when Luffy asks Sogeking to burn down the flag, he asks this to him as a sniper, assuming him to be nearly as good as Usopp.