In what (if any) episodes was it threatened expressly or implicitly? Also, was it ever made clear if Troi had the same power/duty?
"Lonely Among Us" (Season 1, Episode 7) was one instance where Dr.Crusher (backed by many of the senior crew) attempted this ... rather explicitly!
The script indicates this as follows:
RIKER I refuse to allow this, sir.
PICARD Oh? Under what Fleet regulation? Does this resignation threaten the ship and its company in any way?
BEVERLY (moving in) Captain Picard, you are now relieved from duty. I judge you disabled...
The Memory Alpha wiki specifically states that as a qualified psychiatrist and senior officer, the Ship's Counselor has the same authority as the Chief Medical Officer to relieve any crew member (including the Captain) of their duties if they are judged to be mentally unfit to carry them out.
I can't find a canon reference to this principle other than in the Voyager episode "Year of Hell II" where the EMH doctor attempts to relieve Janeway of command due to her mental instability which he describes as "Traumatic Stress Syndrome". Ultimately she refuses and without the crew to back him up (and the brig and sickbay being offline) he's forced to simply make a note of her refusal in the ship's log