I believe it's possible if it's the same operating airline, but otherwise not (as I was told when calling NH a long time ago). That being said, UA and NH are closely tied these days so it may be possible.
BangkokTraveler, I would call UA and NH (in Japan) to check if this is indeed possible.