@BlueChicken,
As history progresses the distinctions between concepts continually grows. When Newton invented his physics, such works were still known as
natural philosophy, which was a one of the domains of philosophy. As the Age of Reason and the Enlightenment came and passed physics, and other 'natural sciences,' began to little-by-little become distinguished as separate fields until the mid 1800s when they were finally called the methodological "Sciences." In this same way,
psychology was rooted in philosophy and then distinguished as a science in 1879.
However, psychology to this day still has not created the level of distinction in its terminology away from philosophy as physics and other sciences have. This is mostly in part because psychology has not created universal methodologies which have been taken up by popular culture. The physical sciences, on the otherhand, have created a successful mystique of methodologies that the popular culture believes is concrete. (However, as most philosophers know, the confidence of the physical sciences is largely illusionary at its core.)
Modern psychology still takes most of its new paradigms from the work done in philosophy. For example, cognitivism, behaviorism, functionalism, identity theory, phenomenology, and existentialism. Since the 1970s, the new fields of science, known mostly as the
cognitive sciences, have arisen. These fields allowed for a bridged gap between more concrete physical sciences and traditional theoretical psychology (and its friends) by basing the majority of their research on laboratory research rather than on the field/theoretic research tradition.
With this brief conceptual history presented, I hope you will understand that Freud and many other eminent psychologists had strong ties to philosophy. Much of the distinctions of these early psychologists are attempts to create the very distinction between philosophy and psychology that I have mentioned. Therefore, it can been understood that not only that these avant-garde thinkers must have been a priori aware of the philosophy in order to draw distinctions and create their theories, but that the further back in history one goes the more interconnected these fields become.