The answer to this question only exists in the courtroom, and even then, it's a blurry grey line.
That's the legal issue, at least.
The moral/ethical part is highly subjective heavily dependent on way to many variables to have any meaningful generic answer.
Finally, sometimes it makes complete sense to outright steal. Especially in UI design where familiarity and conventions go a long ways towards making something usable.
If you're making OSX software, then Apple would actually ENCOURAGE you to use their standard Human Factor interface standards. Apple understands the value of consistency and familiarity.
EDIT: I also didn't catch the 'web app' part of the question. I definitely agree with the others, if it's not a native app, then it shouldn't look like one. This is where familiarity would actually backfire. The UI is familiar for users that are used to native apps on OSX. However, the behaviors won't be the same, so that's actually a huge detriment to usability.