Dogwood can be recognised not only by the flowers . . .
. . . but also the leaves, where the main veins never really make it to the edge of the leaf. They start off in the right direction and then curve round parallel to the leaf edge.
Also if you pull a dogwood leaf apart (or any other Cornus species), the latex in each broken vein solidifies into a slender thread.
Elder flowers are also in clusters, which tend to be saucer shaped rather than domed.
They have pinnate leaves with three or five leaflets on each leaf stalk.
Guelder Rose flowers are a bit like lace-cap hydrangeas with small fertile flowers in the middle and more showy infertile flowers on the edge, with no stigmas or stamens.
And the leaves are almost like maple leaves.
With all these similar flower heads, it's the leaves that help you identify the species. The Wayfaring Tree has very pronounced veins, particularly if you look at the underside of the leaf.
Good luck!