I copied the iOS 5.1 SDK here:
Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
But, I stil
Akhildas' solution worked for me. I was able to build against the 5.1 SDK with XCode 4.5.1. One caveat:
If you drop an SDK from a version of XCode downloaded by a different Apple ID, the App Store will show that you have an update to 4.5.1 (even though you already have it). When you press the update button, it tells you to log in with the other Apple ID.
Strange, I wonder where the account information is buried in the 5.1 SDK?
Also, when I set a base SDK back to iOS 6, it appears you have to restart XCode to recognize that framework.