I think to a person living today with a basic understanding of evolution, the idea that humans and other primates are closely related seems pretty obvious. Their appearance and behaviour very often has an uncanny human-like quality. Was this something that was ever remarked upon before Darwin’s theories became widely known? Or were they widely seen as just another kind of animal with no particular similarity to humans?
So, in a word, yes. But this history is complicated by asking who is doing the observing. The indigenous people of Malaysia, for example, apparently long called their apes the "orangutan" which means the "forest person," a clear indication that they were aware that there was some sort of affinity there, and they described them as essentially having human-like qualities. And accounts of "Gorillas" as a hairy race of animal-people are available in Ancient Greek writings (though there is always some difficulty in identifying exactly what they are talking about and whether it is a modern species, or if the writer actually saw one).
The tricky part is if you mean, "in Western European writings" — because the Western European experience with apes is much more recent than the rest of the world, and indeed many Western European scientists and naturalists regarded accounts of human-like apes from natives as being mythology and folklore. The first living gorilla was not likely seen by European eyes until the 1850s (which set off an intense fascination with great apes in Europe). There was some study of orangutans earlier than this (the Dutch encountered them in Indonesia and Malaysia in the 17th century). Darwin, as an aside, was able to see the first living orangutan ever exhibited at the London Zoo in 1838, which was the first non-human ape he had ever encountered. "Jenny," as she was dubbed, was dressed in human clothing and taught to drink tea — the human-ape connection was very much part of the presentation. It very much moved him, well before he was doing evolutionary theory.
So the affinity was fairly obvious. The question was what the similarities meant. Shared ancestry only sees obvious today (to the educated, anyway) because of the superstructure of theory that sits above it, as well as knowledge of heredity and how it works, as well as knowledge of fossils, and all of that. It was not obvious at the time, and even after Darwin it has remained non-obvious to many people. Even today, there are many people who misunderstand the relationship in a fundamental way (we are not "evolved from chimps," we share a common ancestor with chimps).
With the disclaimer I'm not a historian, but I did study Zoology at uni a very long time ago now...
First up, I'd posit that you don't need a "basic understanding of evolution" to recognise that the "appearance and behaviour" of many primates "very often has an uncanny human-like quality" - you just need to watch them for a wee bit. They eat fruit largely the way we do, pick their noses, jerk off, hug each other, use tools etc.
So, to use the term in your question title, yes people realised they were "similar" before Darwin. In fact Darwin himself realised they were similar "before Darwin". :D
The first orangutan at London Zoo was named Jenny. As you can see from this portrait from 1837 she was dressed up in human clothes. Darwin want to see her in 1838 and she was the first ape he saw. After visting her, he wrote in his notebook:
Let man visit Ouranoutang in domestication, hear expressive whine, see its intelligence when spoken [to]; as if it understands every word said - see its affection. - to those it knew. - see its passion & rage, sulkiness, & very actions of despair; ... and then let him boast of his proud preeminence ... Man in his arrogance thinks himself a great work, worthy the interposition of a deity. More humble and I believe true to consider him created from animals.
It's also worth mentioning "orangutan" comes from Malay (orang hutan), and translated literally is "man forest", ie. "man of the forest". The first truly uncontroversial use of the word was in Observationes medicae, published in 1641 by Dutch anatomist Nicolaes Tulp, however there's some argument the term may have been used in Old Javanese poems, the earliest of which is dated between ~830 - 935. Either way, people living in the native range of orangutans had noticed a similarity long before Darwin.
So, that's "similar" out the way. You also use the term "closely related" in your explanatory text though, which is worth addressing separately as it has a more defined meaning in evolutionary biology than "similar" does.
The answer to this is also "yes". Carl Linnaeus is the "father of modern taxonomy". He's the dude credited with popularising the system of Latin names we use for species these days, known formally as "binomial nomenclature". Linnaeus was deeply religious, believed the organisation of the natural world kind of expressed God's logic, and that species were immutable. Evolution was very definitely not on his mind.
His seminal work is Systema Naturae, first published in 1735 (with lots of revisions in the years after as new species were "discovered"), which was an attempt to classify the natural world, dividing everything first into "Animal/Vegetable/Mineral", then into further groups like order, genus, species etc, based on how related he believed things were (he's famously quoted as saying "God created, Linnaeus organized"). In this he puts humans in the order Anthropomorpha, which also contained apes, monkeys and (believe it or not) sloths. In the final 10th edition of Systema Naturae, published in 1758, he discarded the order Anthropomorpha and replaced it with one we're all more familiar with - Primates.