Break out a volt meter and check signals at the relay box when it works and when it does not:
- http://www.4crawler.com/4x4/CheapTricks/RearWindow.shtml

Any differences will lead you to the problem cause.