Citing paywalled articles accessed via illegal web sharing
Nobody will know how you have gained access to the article. Feel free to cite articles found via whatever sources.
It might not even be illegal to download content from the website; check your local laws and Berne convention (if your country is signed up) to be sure. In any case, this is unlikely to affect your reputation in any way.
Remember to cite the source appropriately; a journal or a book, not a pirate website or any other medium. The pirate website is usually not the publisher. You do not cite the university that has bought access to research (probably funded by public sources and peer reviewed by academicians funded by public sources), or the colleguage who shows you an article, or the library that contained a copy of the article; these all have the same role as pirate website.
You might not want to be vocal about using such a website. Some people still see it as ethically questionable. That said, using various pirate websites is increasingly common, and the status of many academic publishers among academians seems to have taken some hits, so many researchers will not care about how you get your articles.
You also have the ethics tag on the question. The ethics of pirating digital material are a polarized subject. You might want to do your own research here, or ask a new question for what the main arguments for both sides are, if it has not been asked already. Some people say that pirating material is analogous to physical theft, while others say that intellectual monopoly laws are bad and breaking them creates more good than ill. (I happen to think the laws are far too strong and harm humanity, and should be weakened substantially or entirely removed.) I strongly suggest reading on the matter until you have found strong statements of both points of view to come to an informed decision.
If you are at a reputable university you can probably get legal access to nearly everything you need for research just by visiting your university's library and asking for a copy of the article. This is nearly always available to you. If you are grant funded, then grant funds can probably be used to obtain the necessary papers if the university cannot get them. In the US, even my town library has been able to get me access to things just by asking and because they have developed relationships with other (university) libraries. Small universities can have formal relationships with large research universities to "borrow" books and articles.
Likewise, borrowing the resources of colleagues is permitted. If s/he has a legal copy s/he can print it. The printed copy can be loaned to you. There are no issues with this at all.
So, the situation you describe should be rare if you do a bit of legwork.
But if you cite something, cite a legal repository, not a website known to pirate academic work. You don't need to actually own a copy of a paper to cite it, but it is probably a mistake (for your reputation) to flaunt illegal or unethical access.
It probably isn't as difficult or as costly as you imagine to do the right thing.
First, you have to cite if something is relevant for your work! It has nothing to do with how you acquired the article, and even if you do not have the article, just know the abstract or one particular result that is relevant, cite it! (big insight as I entered academia, seldom the articles cited are also read in entirety).
By the way, in academia authors get NO money from their articles, it is all done for reputation in the scientific community; so by not citing you actually do more harm to the individual who wrote the article then by the act of downloading (where maybe just the publisher loses money). And by the way, for scientific articles the system works a little bit different. It is seldom the case that an individual buys individual articles (and if they like to they are tremendously expensive). They are either acquired by your library through subscription, by interlibrary loan (many libraries are connected by networks), given to you by the authors themselves (once I just got a copy from an article that is hard to get in person from the authors send by post after asking him at a conference), or nowadays by the way you asked for... I will not judge what is unethical here but after reading this (or being in academia for yourself some time) you might view it a little bit different...
So, if nothing works you usually end up not getting the article at all!
On a side note, this is a little bit different for books as the authors get some money from them, not much in academia too. But for non-academic books, where the authors have to life from the money, it is definitely unethical. But this is an entirely different system. Do not judge and confuse it by that (which people might do here if they compare it to robbery, netflix etc...).
Also, if you do not cite something relevant, some reviewer of your article will probable notice and either point you to the literature, or if it is a well-known article might conclude that you have done a bad review of the literature yourself.