I think you might be out of luck in doing it with Safari. A quick `strings Safari | grep Mozilla' on the Safari binary indicates that the user agent strings are hardcoded in.
You can specify exact user agents in curl etc though, depending on what it is you're trying to do...