Migrating my thoughts from comments below my answer to another question ...
The square and triangle have little to do with the appearance of the golden ratio here. The essence of the construction is this:

The figure has two salient characteristics:
- $O$ lies on the perpendicular bisector of edge $\overline{RS}$ of the regular pentagon; and,
- $B$ lies on the perpendicular to $\overline{RS}$ through $S$.
This information is all we need to find $\phi$.
Since $\triangle OAM \sim \triangle OBN$, we have
$$\frac{a}{b} = \frac{\frac{1}{2}|\overline{AQ}|}{\frac{1}{2}|\overline{RS}|} = \frac{\text{diagonal of regular pentagon}}{\text{edge of regular pentagon}} = \phi = 1.618\dots$$
(leveraging a well-known property of regular pentagons), and then the golden-ness of the $a/b$ ratio passes to the target $b/(a-b)$ ratio, because that's exactly how the golden ratio works. :) $\qquad\square$
As I write in my referenced comments:
$$\text{[T]he construction is } \textit{sneaky} \text{, in that it makes one think} \\ \text{ that the square and triangle matter, when they don't.}$$
Sure, the even-ness and odd-ness of the square and triangle's respective edge counts naturally guarantee that the target segment has an endpoint on the perpendicular bisector, as per "salient characteristic" $(1)$; and, having the square appropriately sized and positioned makes the perpendicular in $(2)$ a natural part of the construction, as well. (Plus, as OP mentions, the $3$-$4$-$5$ progression has some appeal. I'll also say that I like the sneaky aspect. :) Apart from that, nothing about the particular geometry of those elements comes into play: the triangle could be merely isosceles; the square could be merely rectangular; and/or, any number of additional figures could join them (or replace them) in the chain. It just doesn't matter; so long as $(1)$ and $(2)$ hold, the construction yields the golden ratio.
For example, here's a comparably-sneaky construction that might give the (false) impression that the $5$-$6$-$7$ progression in the component edge counts has some special connection with $\phi$:
