5. $\frac{\left(2 \cdot 2^{-\log _{x} 3}-4\right) \sqrt{2-\sqrt{\log _{x} 3+2}}}{1+\sqrt{\log _{x} 3+5}}>\frac{\left(2^{-\log _{x} 3}-2\right) \sqrt{2-\sqrt{\log _{x} 3+2}}}{\sqrt{\log _{x} 3+5}-2}$

Let's make the substitution $y=\log _{x} 3$.

$$
\begin{aligned}
& \frac{\left(2 \cdot 2^{-y}-4\right) \sqrt{2-\sqrt{y+2}}}{1+\sqrt{y+5}}>\frac{\left(2^{-y}-2\right) \sqrt{2-\sqrt{y+2}}}{\sqrt{y+5}-2} \Leftrightarrow \\
& \left(2^{-y}-2\right)\left(\frac{2}{1+\sqrt{y+5}}-\frac{1}{\sqrt{y+5}-2}\right) \sqrt{2-\sqrt{y+2}}>0
\end{aligned}
$$

Find the domain: $y \geq-5, \quad y \neq-1,2-\sqrt{y+2} \geq 0 \Rightarrow-2 \leq y \leq 2$.

Since the inequality is strict, then for $-2 \leq y<0, \text { or }(y+1)\left(\frac{\sqrt{y+5}-5}{(1+\sqrt{y+5})(\sqrt{y+5}-2)}\right) 0 , } \\
{ \log _{3} x \leq -1 / 2 , }
\end{array} } \\
{ \left[ \begin{array} { c } 
{ \log _{3} x < -1 , } \\
{ \log _{3} x > 1 / 2 , } \\
{ x \neq 1 / 3 , }
\end{array} \right] \Leftrightarrow \left\{\begin{array}{c}
x \in(0 ; 1 / \sqrt{3}] \cup(1 ;+\infty), \\
x \in(0 ; 1) \cup(\sqrt{3} ;+\infty), \\
x \neq 1 / 3,
\end{array} \Leftrightarrow\right.\right.\right.\right.
$$

$$
x \in(0 ; 1 / 3) \cup(1 / 3 ; 1 / \sqrt{3}] \cup(\sqrt{3} ;+\infty)
$$
Answer: $x \in (0 ; 1 / 3) \cup (1 / 3 ; 1 / \sqrt{3}] \cup (\sqrt{3} ; +\infty)$.