Xcode installed but not recognized on App Store
You can't make the App Store recognize an Xcode installed from a dmg. Besides that, the dmg distribution method is not used by Apple any longer so you most probably got an old Xcode version anyway.

New versions of Xcode are only distributed via the App Store. Just download/install the most current version of Xcode from the App Store again (it's free anyway)