I found plenty of info on this for Safari 3, but things have evidently changed in version 4. I just happened to stumble upon the answer by experimenting, so posting it here
Checked in Safari 5.1.7 for windows.
In the top right corner click Settings gear and navigate to Preferences>Advanced Tab.
Check "Show Develop menu in menu bar"