Example 5 As shown in Figure 6, square $A B C D$ and rectangle $B E F G$ share a common vertex $B$, the side length of square $A B C D$ is $6 \mathrm{~cm}$, and the length of rectangle $B E F G$ is $9 \mathrm{~cm}$. What is the width of the rectangle in $\mathrm{cm}$?
Connect $A E$, draw $A M \perp B E$ at $M$, and draw $E N \perp A B$ at $N$, then
$$
\begin{aligned}
S_{\angle A B E} & =\frac{1}{2} A B \cdot N E \\
& =\frac{1}{2} A B \cdot B C=\frac{1}{2} S_{I B E D}, \\
S_{\angle L I H E} & =\frac{1}{2} B E \cdot A M \\
& =\frac{1}{2} B E \cdot B G=\frac{1}{2} S_{B E F G}
\end{aligned}
$$

Thus, $S_{A B C D}=S_{B E F G}$, which means $9 B G=6 \cdot 6$, so $B G=4$. Therefore, the width of the rectangle is $4 \text{ cm}$.