The moral guidance for this answer is found in an area called, "moral cooperation with evil." Here moral cooperation is when a person freely and knowingly assists another person in performing an immoral act, i.e. an action that is objectively evil. Such cooperation means that a person concurs in another’s sinful act, and participates in a way that helps bring the sinful act to completion. The Catechism teaches, "Anyone who uses the power at his disposal in such a way that it leads others to do wrong becomes guilty of scandal and responsible for the evil that he has directly or indirectly encouraged."(#2287)This is from an article By Fr. William P. Saunders, a Catholic Herald Columnist (From the issue of 9/5/02)
Now we come to some classic distinctions in morality. Formal cooperation is when a person (the cooperator) first of all gives consent to the evil action of another (the actor). Here the cooperator shares the same intention as the actor. The cooperator also joins in the actual performance of the evil action or supplies the actor with the means of performing it. Essentially, he consents to and helps enact the sin. For example, using the example of abortion, a nurse who assists a doctor in performing an abortion and shares the same intention is formally cooperating with evil. A legislator who actively promotes abortion legislation enabling innocent human beings to perish is guilty of formal cooperation with evil. Formal cooperation with evil is always wrong, and the cooperator shares in the guilt of the sin of the actor.
For more of the discussion, especially regarding remote and proximate material cooperation and for some guidance on the question, "Is there a proportionate reason for cooperating with this evil action?", see this article.