
90 Cal.Rptr.2d 743 (1999)
76 Cal.App.4th 970
KENDALL-JACKSON WINERY, LTD., Petitioner,
v.
The SUPERIOR COURT of Stanislaus County, Respondent;
E. & J. Gallo Winery, Real Party in Interest.
No. F033305.
Court of Appeal, Fifth District.
December 3, 1999.
As Modified on Denial of Rehearing January 3, 2000.
Review Denied February 23, 2000.
*746 Ropers, Majeski, Kohn & Bentley, Daniel E. Alberti, Mark G. Bonino, Redwood City, Mary A. Kiker, Los Angeles, and Kathryn C. Curry, for Petitioner.
No appearance for Respondent.
Blecher & Collins, Maxwell M. Blecher, Los Angeles, Steven J. Cannata; Damrell, Nelson, Schrimp, Pallios & Ladine, Roger M. Schrimp, Modesto; Orrick, Herrington & Sutcliffe, George A. Yuhas and Laurie Chambers, San Francisco, for Real Party in Interest.

OPINION
THAXTER, Acting P.J.
The doctrine of unclean hands does not deny relief to a plaintiff guilty of any past misconduct; only misconduct directly related to the matter in which he seeks relief triggers the defense. (11 Witkin, Summary of Cal. Law (9th ed. 1990) Equity, § 10, p. 686.) The trial court found that Kendall-Jackson Winery, Ltd. (Kendall-Jackson), the defendant in a malicious prosecution action, had no relevant evidence that the plaintiff, E. & J. Gallo Winery (Gallo), acted with unclean hands in relation to its claim and ordered summary adjudication for the plaintiff on Kendall-Jackson's unclean hands defense. The novel issue presented is this: When "unclean hands" is raised as an affirmative defense to a malicious prosecution claim, is the relevant misconduct limited to that which affected the defendant's decision to file and pursue the prior lawsuit? We hold it is not; misconduct in the particular transaction or connected to the subject matter of the litigation that affects the equitable relations between the litigants is sufficient to trigger the defense.
We issue a writ of mandate directing the trial court to vacate its order granting summary adjudication for real party in interest on petitioner's unclean hands affirmative defense and to enter a new order denying the motion.

FACTS AND PROCEDURAL HISTORY
Kendall-Jackson has a reputation for producing high quality, mid-priced varietal wines. In 1994, Kendall-Jackson was selling over $100 million worth of Vintner's Reserve wine a year, and its chardonnay was the number one selling chardonnay in the United States. (Kendall-Jackson Winery v. E. & J. Gallo Winery (9th Cir.1998) 150 F.3d 1042, 1045.) Gallo is the largest wine producer in the world. But, unlike Kendall-Jackson, Gallo has a reputation for producing lower-priced, non-premium wines. (Ibid.)
During the 1990's, the market for non-premium wines declined rapidly. Gallo researched how best to enter the premium wine market. Much of its research was directed at the success of the market leader  Kendall-Jackson Vintner's Reserve. Gallo learned that consumers associate the name "Gallo" with "jug wine" and that a colorful grape leaf design attracts consumers. In accord with these results, Gallo introduced in the fall of 1995 a line of premium wine, Turning Leaf, that featured a leaf motif and did not use the Gallo name. (Kendall-Jackson Winery v. E. & J. Gallo Winery, supra, 150 F.3d at p. 1045.)
In April 1996, Kendall-Jackson sued Gallo for damages and injunctive relief on causes of action for trademark infringement, trade dress violations and unfair business practices. Kendall-Jackson alleged that Gallo's Turning Leaf wine label and overall appearance mimicked its successful Vintner's Reserve wines. While the lawsuit alleged unfair marketing practices in retail displays, the litigation focused on the label and packaging similarities rather than marketing strategies. (Kendall-Jackson Winery v. E. & J. Gallo Winery, supra, 150 F.3d 1042.) Gallo denied employing unlawful marketing practices and resisted disclosing material related *747 to its marketing strategies. The court found for Gallo on the trademark infringement and unfair competition claims. After a 12-day trial, a jury found for Gallo on the trade dress infringement and "palming off claims. Judgment for Gallo was affirmed on appeal. (Ibid.)
In September 1997, Gallo filed this action against Kendall-Jackson for malicious prosecution and intentional interference with contract. Gallo alleged that Kendall-Jackson had filed and prosecuted the federal action without probable cause and for the improper purpose of harassing a competitor. In addition, Kendall-Jackson had induced Chris Lynch, Gallo's former director of marketing, to breach his confidentiality agreement with Gallo. Kendall-Jackson used the confidential information obtained "to file a facially plausible, but knowingly false lawsuit against Gallo." Among the defenses raised by Kendall-Jackson's answer was an allegation that Gallo's claims were barred by the doctrine of unclean hands.
In response to Gallo's interrogatory requesting each fact supporting the defense, Kendall-Jackson stated:
(1) Kendall-Jackson has learned that Gallo has numerous representatives working for chain stores who are involved with shelf schematics for the stores or are otherwise involved with moving wine products. Alternatively, Gallo representatives have directed non-Gallo employees to make schematic changes for Gallo.
(2) Gallo employs a technique which it calls "piggy-back adjacencies." The technique involves training its distributor/salesperson to place an inferior, lowerpriced Gallo product adjacent to a higher-priced category leader. The category leader's display attracts the consumer's attention. When the consumer reaches for the well-known product, he or she will see the lower-priced Gallo product, and may buy that product instead.
(3) Gallo employees have admitted moving Turning Leaf wines next to Kendall-Jackson wines, which would require them to move a non-Gallo product in violation of federal and state regulations.
Kendall-Jackson identified a number of documents that described conduct supporting its unclean hands defense. The documents contain direct and circumstantial evidence showing that Gallo used its influence to have retailers place Turning Leaf wine next to Kendall-Jackson Vintner's Reserve wine. The documents also reflect that Gallo representatives or employees moved Kendall-Jackson products, provided free labor to retailers in exchange for favorable product placement, prepared shelf schematics for retailers, maintained offices in some retailers' stores, wore retailer badges while stocking product, removed Kendall-Jackson wines from a retail store, participated in retailer resets which involved handling a competitor's product, and interfered with Kendall-Jackson's marketing displays. While most of the documents were generated during the federal litigation (1996-1997), many reflected or implied ongoing unclean hands conduct since 1994.
Kendall-Jackson designated Michael Haarstad, its director of marketing, as the person most knowledgeable about the facts supporting its unclean hands defense. Gallo deposed Haarstad. According to Gallo, Haarstad confirmed that the documents produced were the only evidence known to Kendall-Jackson that support its defense, and Haarstad was unaware of any Gallo misconduct relating to Turning Leaf wine that occurred prior to the filing of the infringement action. In fact, Haarstad's testimony provided considerably more evidence regarding Gallo's purportedly illegal or improper marketing strategies in relation to Kendall-Jackson.
At one point in his deposition, Haarstad stated he did not recall any unclean hands conduct by Gallo concerning Turning Leaf before the federal lawsuit was filed. Later, however, he stated that between 1994 and 1996, he was generally aware of Gallo's influence over, and inappropriately *748 close working relationship with, chain stores. After the lawsuit was filed and Kendall-Jackson elicited written information from employees in the field, he became aware of the depth and scope of the improper activity. Haarstad also testified that he had received oral reports from the field regarding inappropriate Gallo adjacencies from 1994 through the period when Turning Leaf was introduced.

MOTION FOR SUMMARY ADJUDICATION
Gallo moved for summary adjudication on Kendall-Jackson's unclean hands defense. Gallo admitted for purposes of the motion that the "actions described in [Kendall-Jackson]'s unclean hands documents took place." Gallo contended, however, it was entitled to judgment on the defense because the conduct identified was not directly related to its malicious prosecution claim. According to Gallo, in a malicious prosecution action, the plaintiffs unclean hands conduct must have affected the defendant's decision to file and pursue the underlying lawsuit. Thus, only unclean hands conduct known to the defendant at the time it filed the underlying suit is relevant. Because Kendall-Jackson's documents describing the misconduct were generated after Kendall-Jackson filed the underlying action, they were irrelevant, and Kendall-Jackson had no evidence to support its defense.
Gallo also argued that further discovery would not cure the evidentiary defects. Because the unclean hands conduct had to affect Kendall-Jackson's decision to file the infringement action, only unclean hands conduct known to Kendall-Jackson at that time could be used to support its defense.
Kendall-Jackson opposed the motion on procedural and substantive grounds.
The trial court granted the motion for summary adjudication. It found that Kendall-Jackson had no relevant evidence that Gallo acted with unclean hands in relation to its malicious prosecution or inducing breach of contract claims. The court denied Kendall-Jackson's request to continue the matter for further discovery, finding no showing of due diligence.
Kendall-Jackson filed a petition for writ of mandate challenging those orders. This court issued an order to show cause.

DISCUSSION

SUMMARY ADJUDICATION/STANDARD OF REVIEW
Summary adjudication of an affirmative defense is properly granted when there is no triable issue of material fact as to the defense, and the moving party is entitled to judgment on the defense as a matter of law. (Code Civ. Proc., § 437c, subds. (c), (f)(1).) In this case, moving party Gallo had to show there was no evidence to support Kendall-Jackson's unclean hands affirmative defense. (Code Civ. Proc., § 437c, subd. (o)(2).) Once Gallo met that burden, the burden shifted to Kendall-Jackson to set forth specific facts showing a triable issue of material fact existed as to the defense. (Ibid.) On review, we independently assess the correctness of the trial court's ruling, applying the same legal standard as the trial court. (Tilley v. Schulte (1999) 70 Cal. App.4th 79, 82, 82 Cal.Rptr.2d 497.) We construe Gallo's papers strictly and Kendall-Jackson's liberally and resolve any doubts as to the propriety of granting the motion in favor of Kendall-Jackson. (Jacobs v. Universal Development Corp. (1997) 53 Cal.App.4th 692, 697, 62 Cal. Rptr.2d 446.)

Gallo Failed to Establish It Was Entitled to Judgment on the Unclean Hands Affirmative Defense

UNCLEAN HANDS
The defense of unclean hands arises from the maxim, "`He who comes into Equity must come with clean hands.'" (Blain v. Doctor's Co. (1990) 222 Cal. App.3d 1048, 1059, 272 Cal.Rptr. 250 (Blain).) The doctrine demands that a plaintiff act fairly in the matter for which *749 he seeks a remedy. He must come into court with clean hands, and keep them clean, or he will be denied relief, regardless of the merits of his claim. (Precision Co. v. Automotive Co. (1945) 324 U.S. 806, 814-815, 65 S.Ct. 993, 89 L.Ed. 1381; Hall v. Wright (9th Cir.1957) 240 F.2d 787, 794-795.) The defense is available in legal as well as equitable actions. (Fibreboard Paper Products Corp. v. East Bay Union of Machinists (1964) 227 Cal.App.2d 675, 728, 39 Cal.Rptr. 64 (Fibreboard); Burton v. Sosinsky (1988) 203 Cal.App.3d 562, 574, 250 Cal.Rptr. 33.) Whether the doctrine of unclean hands applies is a question of fact. (CrossTalk Productions, Inc. v. Jacobson (1998) 65 Cal.App.4th 631, 639, 76 Cal.Rptr.2d 615.)
The unclean hands doctrine protects judicial integrity and promotes justice. It protects judicial integrity because allowing a plaintiff with unclean hands to recover in an action creates doubts as to the justice provided by the judicial system. Thus, precluding recovery to the unclean plaintiff protects the court's, rather than the opposing party's, interests. (Fibreboard, supra, 227 Cal.App.2d at p. 727, 39 Cal.Rptr. 64; Gaudiosi v. Mellon (3d Cir.1959) 269 F.2d 873, 881.) The doctrine promotes justice by making a plaintiff answer for his own misconduct in the action. It prevents "a wrongdoer from enjoying the fruits of his transgression." (Precision Co. v. Automotive Co., supra, 324 U.S. at p. 815, 65 S.Ct. 993; Keystone Co. v. Excavator Co. (1933) 290 U.S. 240, 245, 54 S.Ct. 146, 78 L.Ed. 293.)
Not every wrongful act constitutes unclean hands. But, the misconduct need not be a crime or an actionable tort. Any conduct that violates conscience, or good faith, or other equitable standards of conduct is sufficient cause to invoke the doctrine. (DeRosa v. Transamerica Title Ins. Co. (1989) 213 Cal.App.3d 1390, 1395-1396, 262 Cal.Rptr. 370; Precision Co. v. Automotive Co., supra, 324 U.S. at pp. 814-815, 65 S.Ct. 993.)
The misconduct that brings the clean hands doctrine into play must relate directly to the cause at issue. Past improper conduct or prior misconduct that only indirectly affects the problem before the court does not suffice. The determination of the unclean hands defense cannot be distorted into a proceeding to try the general morals of the parties. (Fibreboard supra, 227 Cal.App.2d at pp. 728-729, 39 Cal.Rptr. 64.) Courts have expressed this relationship requirement in various ways. The misconduct "must relate directly to the transaction concerning which the complaint is made, i.e., it must pertain to the very subject matter involved and affect the equitable relations between the litigants." (Id. at p. 728, 39 Cal.Rptr. 64.) "[T]here must be a direct relationship between the misconduct and the claimed injuries `"... so that it would be inequitable to grant [the requested] relief."'" (Mattco Forge, Inc. v. Arthur Young & Co. (1997) 52 Cal.App.4th 820, 846, 60 Cal. Rptr.2d 780.) "The issue is not that the plaintiffs hands are dirty, but rather `"`that the manner of dirtying renders inequitable the assertion of such rights against the defendant.'"'" (Ibid.) The misconduct must "`"prejudicially affect the rights of the person against whom the relief is sought so that it would be inequitable to grant such relief."'" (Ibid.)
From these general principles, the Blain court gleaned a three-pronged test to determine the effect to be given to the plaintiff's unclean hands conduct. Whether the particular misconduct is a bar to the alleged claim for relief depends on (1) analogous case law, (2) the nature of the misconduct, and (3) the relationship of the misconduct to the claimed injuries. (Blain, supra, 222 Cal.App.3d at p. 1060, 272 Cal.Rptr. 250; accord, Unilogic, Inc. v. Burroughs Corp. (1992) 10 Cal.App.4th 612, 618-621, 12 Cal.Rptr.2d 741; CrossTalk Productions, Inc. v. Jacobson, supra, 65 Cal.App.4th at pp. 641-643, 76 Cal.Rptr.2d 615.) We will analyze the parties' contentions under the three prongs.


*750 A. Analogous Case Law

Two published cases have applied the doctrine of unclean hands as a defense to a malicious prosecution claim. In the first case, insurance agent Pond sold an INA (Insurance Company of North America) aircraft liability policy to Mission, whose president was Pond's long-time friend. The policy included minimum pilot training requirements that were the same as an earlier INA policy issued to Mission, but stricter than the requirements of Mission's current AAU (Associated Aviation Underwriters) policy. There was a series of meetings regarding the policy, resulting in Pond sending a letter to Mission agreeing to coverage. Regarding pilot minimums, the letter said, "same as before." Three days before Mission received the actual policy, one of its planes crashed due to pilot error, killing all aboard. (Pond v. Insurance Co. of North America (1984) 151 Cal.App.3d 280, 284-285, 291, 198 Cal. Rptr. 517 (Pond).)
In the resulting wrongful death actions, INA defended Mission under a reservation of rights on the ground that the deceased pilot did not meet the minimum training requirements enumerated in the INA policy. Mission contended that Pond and INA had agreed to replace the AAU policy with an INA policy with equivalent pilot minimums. Mission's position was bolstered by Pond's testimony that he had not explained to Mission what "same as before" referred to. As a result of the coverage ambiguity, INA settled the wrongful death suit. (Pond, supra, 151 Cal.App.3d at pp. 285-286, 198 Cal.Rptr. 517.) INA then sought indemnity from Pond, alleging that Pond's negligent representation created an ambiguity that made INA potentially liable for an excluded claim. (Id. at p. 285, 198 Cal.Rptr. 517.) During this litigation, discovery revealed that Pond had forwarded to Mission a letter from INA stating pilot minimums before Mission agreed to the coverage. On this evidence the trial court found that Pond had done nothing to mislead Mission regarding the pilot minimums and entered judgment for him on INA's indemnity claim. (Id. at p. 286, 198 Cal. Rptr. 517.)
Pond sued INA for malicious prosecution. Discovery in this action revealed additional evidence that Pond had advised Mission of the actual pilot minimums and evidence indicating Pond had lied in the wrongful death litigation regarding his understanding of the intended pilot minimums. (Pond, supra, 151 Cal.App.3d at pp. 286, 290, 198 Cal.Rptr. 517.) The appellate court affirmed summary judgment for INA on its unclean hands defense.
The equitable principles underlying the unclean hands doctrine did not require a finding that Pond was guilty of perjury, concealment, or other illegal conduct. Any unconscientious conduct connected with the controversy before the court was sufficient to warrant application of the unclean hands defense. Further, Pond's unclean hands conduct in the indemnity action was connected with and related to the malicious prosecution action because the indemnity suit was the basis of the malicious prosecution claim. (Pond, supra, 151 Cal. App.3d at pp. 286, 290-291, 198 Cal.Rptr. 517.)
In the second case, Transamerica opened an escrow account for the sale of DeRosa's property to Lapitan. DeRosa executed a quitclaim deed and deposited it in escrow. A Transamerica employee gave the deed to Lapitan and her fiance Flint prior to the close of escrow and Lapitan recorded it. DeRosa asked Transamerica to return title to him. Transamerica commenced a quiet title action to do so. De-Rosa became uncooperative, which resulted in Transamerica adding a fraud cause of action against him in the quiet title action. DeRosa prevailed on Transamerica's fraud claim and sued for malicious prosecution. (DeRosa v. Transamerica Title Ins. Co., supra, 213 Cal. App.3d at pp. 1393-1395, 262 Cal.Rptr. 370 (DeRosa).)
*751 Transamerica raised an unclean hands defense and moved for summary judgment. In opposing the motion, DeRosa submitted a declaration stating he did not intend to defraud Transamerica. But, he acknowledged unconscientious conduct in the transaction. DeRosa had originally sold the property to Flint but agreed to be title owner of the property to enable Flint to avoid his creditors. Nevertheless, De-Rosa considered Flint the true owner of the property and received regular payments from him on the purchase promissory note. Eventually, DeRosa tired of the arrangement and asked Flint to convey title to someone else. Flint agreed and the Transamerica escrow was opened to effectuate the exchange. However, when Flint unilaterally sold the property to a third party using the quitclaim deed placed in the Transamerica escrow, DeRosa had Transamerica pursue an action to quiet title in him without revealing his true relationship with Flint to Transamerica. (De-Rosa, supra, 213 Cal.App.3d at pp. 1395-1396, 262 Cal.Rptr. 370.) The trial court granted Transamerica summary judgment on its unclean hands defense.
The appellate court rejected DeRosa's argument that the malicious prosecution action was unrelated to his conduct in assisting Flint to defraud his creditors and, therefore, the unclean hands doctrine should not apply. The malicious prosecution action arose from the quiet title action that Transamerica prosecuted on DeRosa's behalf. It was only because DeRosa concealed the true facts underlying the conveyance that Transamerica became involved and, subsequently, proceeded against DeRosa for fraud. The malicious prosecution action was directly related to DeRosa's unconscionable conduct in the underlying action. (DeRosa, supra, 213 Cal.App.3d at p. 1397, 262 Cal.Rptr. 370.)
Under the analogous case law prong of the Blain test, a plaintiffs unclean hands conduct in the underlying action or in the transaction that was the subject of that action can preclude relief in a subsequent malicious prosecution suit.

B. Nature of the Misconduct
The second prong of the Blain test examines the nature of the misconduct. (Blain, supra, 222 Cal.App.3d at p. 1060, 272 Cal.Rptr. 250.) Kendall-Jackson's unclean hands defense is based on two types of alleged marketing misconduct: Gallo's undue influence over shelf schematics and other retailer merchandising activity, and Gallo's movement of a competitor's wines to create product adjacencies.

Alcoholic Beverage Control Laws and Regulations
California has a comprehensive statutory scheme restricting "tied-house" arrangements in the distribution of alcoholic beverages. (Bus. & Prof.Code, §§ 25500-25512.) The laws seek to avoid the "evils and excesses" of "disorderly marketing conditions" that plagued the alcoholic beverage industry prior to prohibition. (California Beer Wholesalers Assn., Inc. v. Alcoholic Bev. etc. Appeals Bd. (1971) 5 Cal.3d 402, 407, 96 Cal.Rptr. 297, 487 P.2d 745.) The "tied-house" prohibitions target two particular dangers: the ability of large firms to dominate local markets through vertical and horizontal integration and the excessive sales of alcoholic beverages produced by the overly aggressive marketing techniques of larger alcoholic beverage concerns. (Ibid.)
The Legislature recognized that small retailers were unable to cope with the pressures exerted by larger manufacturing interests. Thus, the statutes sought to remove the manufacturer's influence over the retailer, which could result in preference for the manufacturer's product. (California Beer Wholesalers Assn., Inc. v. Alcoholic Bev. etc. Appeals Bd., supra, 5 Cal.3d at pp. 407-408, & fn. 8, 96 Cal.Rptr. 297, 487 P.2d 745.) Under the statutory scheme, all levels of the alcoholic beverage industry must remain separate; producers are not to be involved with, or *752 exercise influence ove., retail (Id. at pp. 407, 408, 96 Cal.Rptr. 297, 487 P.2d 745.)
The Department of Alcoholic Beverage Control has adopted rules to enforce the statutory scheme. Section 106 of title 4 of the California Code of Regulations provides that no supplier shall, directly or indirectly, give anything of value to any retailer except as authorized by the Alcoholic Beverage Control Act. Providing services in the form of rearranging a retailer's displays is prohibited, as is interfering with the product display of competing sellers inside retail outlets. (Turner v. Anheuser-Busch, Inc. (1994) 7 Cal.4th 1238, 1258, fn. 12, 32 Cal.Rptr.2d 223, 876 P.2d 1022; Markstein Distributing Co. v. Rice (1976) 65 Cal.App.3d 333, 338-339, 135 Cal. Rptr. 255.)

(1) Gallo's undue influence over shelf schematics and other retailer activity
Shelf schematics are product display plans that wine producers prepare and present to a retailer. The plans typically propose the amount of shelf space and location to be given to individual brands. Schematics are intended to assist the retailer to maximize revenues through product placement. Both Kendall-Jackson and Gallo provide shelf schematics to retailers. The practice is legal.
Kendall-Jackson contends that Gallo's use of schematics is illegal or improper because Gallo works too closely with retailers, provides goods or services of value in exchange for the retailer's use of Gallo schematics, and uses its considerable influence in the industry to achieve favorable shelf schematics. Kendall-Jackson's evidence disclosed that a number of Gallo representatives were employed by large supermarket chains, had offices in the chains or were provided with perquisites such as store badges which enabled them to move more freely about the retailer's premises than other wine distributors. In addition, Gallo representatives or employees participated in restocking or stock resets for retailers in violation of Alcoholic Beverage Control regulations.

(2) Gallo's movement of competitor's wines to create product adjacencies
Product adjacencies are a marketing strategy whereby a wine producer attempts to have its brands displayed adjacent to the market leader brand in the relevant price segment. Adjacencies maximize the exposure of the adjacent brand. Product adjacencies are lawful and commonly used.
Kendall-Jackson contends Gallo's use of adjacencies is illegal and improper to the extent Gallo accomplishes adjacencies by physically moving a competitor's product. A wine distributor can ask a retailer to move a competitor's product, but the distributor cannot lawfully move the product. Kendall-Jackson's documents include direct and circumstantial evidence that Gallo distributors or employees moved bottles of Kendall-Jackson or another competitor to create product adjacencies between Kendall-Jackson Vintner's Reserve and Turning Leaf wines.
The nature of the misconduct indicated by Kendall-Jackson's evidence  Gallo's ties with retailers and movement of a competitor's product  violates the letter and the spirit of the Alcoholic Beverage Control Act. Such evidence supports a defense of unclean hands under the second prong of the Blain test. (Hall v. Wright, supra, 240 F.2d at p. 795 [unclean hands conduct need not constitute unfair competition under California law].) Gallo has not established that the proffered misconduct is insufficient as a matter of law to support an unclean hands affirmative defense.


*753 C. Relationship of the Misconduct to the Injuries

The final prong of the Blain test requires examination of the relationship between the plaintiffs misconduct and the claimed injuries. (Blain, supra, 222 Cal. App.3d at p. 1060, 272 Cal.Rptr. 250.) The misconduct that brings the unclean hands doctrine into play must relate directly to the transaction concerning which the complaint is made. It must infect the cause of action involved and affect the equitable relations between the litigants. (Pond, supra, 151 Cal.App.3d at p. 290, 198 Cal. Rptr. 517.) Cases illustrating preclusive unclean hands conduct directly related to the transaction at issue include Unilogic, Inc. v. Burroughs Corp., supra, 10 Cal. App.4th 612, 618, 621, 12 Cal.Rptr.2d 741 (although defendant converted plaintiffs proprietary information during a failed joint project, plaintiffs unclean hands  bribery to obtain the contract, failure to disclose financial difficulties, and its own conversion of defendant's property  during the same joint project precluded relief); Camp v. Jeffer, Mangels, Butler & Marmaro (1995) 35 Cal.App.4th 620, 639, 41 Cal.Rptr.2d 329 (plaintiffs' suit for wrongful termination was barred by evidence they had lied on their job applications); and Blain, supra, 222 Cal.App.3d 1048, 1058, 1063, 272 Cal.Rptr. 250 (doctrine of unclean hands precluded legal malpractice action based on injuries caused when physician-defendant followed the advice of his attorney to lie at a deposition, physician's emotional distress and inability to work as a physician were attributable to his own misconduct).
Cases illustrating misconduct not sufficiently related to the transaction to warrant application of the unclean hands doctrine include Vacco Industries, Inc. v. Van Den Berg (1992) 5 Cal.App.4th 34, 50, 52-53, 6 Cal.Rptr.2d 602 (plaintiffs wrongful discharge of defendant was immaterial in a suit seeking compensatory and injunctive relief for defendant's misappropriation of plaintiffs trade secrets: "If the conclusion were otherwise, every terminated employee could justify and defend charges of theft and misappropriation of his former employer's proprietary interests by establishing breach or wrongful termination of an express or implied employment contract.... Such a result finds no support in law or common sense"); Murillo v. Rite Stuff Foods, Inc. (1998) 65 Cal.App.4th 833, 845, 851-852, 77 Cal.Rptr.2d 12 (plaintiffs unclean hands use of falsified immigration documents to obtain employment was not related to and did not preclude her sexual harassment claim); Fibreboard supra, 227 Cal.App.2d 675, 729, 39 Cal. Rptr. 64 (employer's breach of union contract was not directly related to transaction before the court  employer's suit for damages due to union members' tortious conduct on the picket line); and Germo Mfg. Co. v. McClellan (1930) 107 Cal.App. 532, 541, 290 P. 534 (plaintiffs unfair practices in dealings with others were not related to its suit to enjoin former employees from using trade secrets).
Gallo contends that its alleged unclean hands conduct'  illegal and improper marketing practices directed at Kendall-Jackson  is unrelated to the injuries it claims from having to defend against Kendall-Jackson's baseless and malicious infringement action. Gallo urges this court to apply a narrow rule in determining whether particular misconduct precludes a malicious prosecution claim. According to Gallo, the gist of a malicious prosecution action is that the prior lawsuit was filed maliciously and without probable cause. Therefore, in order to bear the requisite direct relationship to a malicious prosecution claim, the unclean hands conduct must relate directly to the defendant's decision to file and pursue the prior litigation. Neither analogous case law nor the equitable principles underlying the unclean hands doctrine supports this narrow rule.
*754 While the misconduct in Pond and De-Rosa affected the defendant's decision to file the underlying lawsuit, neither court tied its application of the unclean hands doctrine to that fact. Rather, the courts looked at the larger picture and concluded that the plaintiffs misconduct had infected the malicious prosecution cause of action, or had related directly to the transaction concerning which the complaint was made  the underlying lawsuit. (Pond, supra, 151 Cal.App.3d at p. 290, 198 Cal. Rptr. 517; DeRosa, supra, 213 Cal.App.3d at p. 1397, 262 Cal.Rptr. 370.) Simply stated, permitting Pond or DeRosa to recover damages for defending the unsuccessful underlying actions was unjust because their misconduct had precipitated those actions and thus affected the equitable relations between the litigants in the malicious prosecution action. Neither Pond nor DeRosa support Gallo's narrow application of the doctrine.
Moreover, the unclean hands doctrine is not a legal or technical defense to be used as a shield against a particular element of a cause of action. Rather, it is an equitable rationale for refusing a plaintiff relief where principles of fairness dictate that the plaintiff should not recover, regardless of the merits of his claim. It is available to protect the court from having its powers used to bring about an inequitable result in the litigation before it. (Ford v. Buffalo Eagle Colliery Co. (4th Cir.1941) 122 F.2d 555, 563; 5 McCarthy on Trademarks and Unfair Competition (4th ed.1997) § 31:45.) Thus, any evidence of a plaintiffs unclean hands in relation to the transaction before the court or which affects the equitable relations between the litigants in the matter before the court should be available to enable the court to effect a fair result in the litigation. The equitable principles underlying the doctrine militate against limiting the unclean hands defense in a malicious prosecution claim to misconduct that bears on the defendant's decision to file the prior action.
Gallo contends additional considerations justify restricting the use of an unclean hands defense in a malicious prosecution action. Citing Leonardini v. Shell Oil Co. (1989) 216 Cal.App.3d 547, 570, 264 Cal.Rptr. 883, Gallo argues that to prove probable cause, the malicious prosecution defendant is limited to evidence known to him at the time he filed the prior action. He cannot introduce evidence to show probable cause that occurred after he filed the lawsuit. Permitting the defendant to present evidence that was unknown to him when he filed the prior suit or that occurred after he filed suit, under the guise of an unclean hands defense, would render the temporal probable cause limitation meaningless.[1] Gallo's argument is flawed in that it fails to recognize that unclean hands goes beyond the justification for filing the malicious prosecution suit; unclean hands concerns the far broader question of a party's misconduct in the matter. (New Hampshire Ins. Co. v. Ridout Roofing Co. (1998) 68 Cal.App.4th 495, 507, 80 Cal.Rptr.2d 286.)
Gallo next argues that permitting Kendall-Jackson to use evidence that it chose not to present in the prior action to mount an unclean hands defense to the malicious prosecution claim sanctions relitigation of tangential claims in the prior action. This contention is unpersuasive in the context of a malicious prosecution lawsuit, which in and of itself is a relitigation of the prior action. (Verdier v. Verdier (1957) 152 Cal. App.2d 348, 353, 313 P.2d 123 [probable cause in a malicious prosecution action can be shown by proving that plaintiff committed the act charged in the underlying action even though a jury acquitted him or her of the charge]; DeRosa, supra, 213 Cal.App.3d at p. 1397, 262 Cal.Rptr. 370 [although jury found for plaintiff on defendant's *755 prior fraud claim, defendant's unclean hands defense based on the same fraudulent conduct precluded relief for plaintiff in his malicious prosecution action].)
The fundamental interest protected by the malicious prosecution tort is freedom from unjustifiable and unreasonable litigation. (Hufstedler, Kaus & Ettinger v. Superior Court (1996) 42 Cal. App.4th 55, 65, 49 Cal.Rptr.2d 551.) But, malicious prosecution is a disfavored action. Constitutional principles, as well as strong public policy, favor open access to the courts for the resolution of conflicts and the redress of grievances. (Downey Venture v. LMI Ins. Co., (1998) 66 Cal. App.4th 478, 493, 78 Cal.Rptr.2d 142.) This strong public policy, coupled with the equitable principles underlying the doctrine of unclean hands  to protect the integrity of the court and ensure a just result  bode in favor of a broad application of the doctrine in malicious prosecution actions.
Accordingly, Gallo's contention that the unclean hands conduct must relate directly to the defendant's decision to file and pursue the prior litigation in order to bear the requisite direct relationship to a plaintiffs malicious prosecution claim is without merit.
In the alternative, Gallo contends that even if the unclean hands evidence need not relate to Kendall-Jackson's decision to file the infringement lawsuit, Kendall-Jackson's evidence in this case does not relate directly to or "infect" the underlying infringement action or the malicious prosecution claim, as a matter of law. The contention has two components: (1) Kendall-Jackson's unclean hands defense is based on conduct that occurred long after the prior lawsuit was filed, and (2) the purported improper marketing practices have nothing whatsoever to do with Gallo's malicious prosecution claims or the prior infringement action.
Gallo's first contention fails on the evidence. Haarstad testified that he was aware of Gallo's unclean hands conduct in 1994, and the documents produced reflect or imply ongoing unclean hands conduct since before the infringement action was filed.
Gallo's second contention also fails. Kendall-Jackson's infringement action sought damages and to enjoin Gallo's use of its Turning Leaf label and packaging. The gist of the lawsuit was that Gallo attempted to capitalize on Kendall-Jackson's success as the market leader in premium wine sales by using a variety of unfair marketing strategies  similar label and trade dress, omitting the Gallo name from the bottle, placing Turning Leaf adjacent to Vintner's Reserve wine in store displays, and so forth. The theory of Kendall-Jackson's unclean hands defense is, although Gallo prevailed on the infringement claims, it is unfair to permit Gallo compensation for defending against Kendall-Jackson's claims because Gallo actually engaged in illegal and improper practices directed at Kendall-Jackson with respect to the marketing of Turning Leaf wines.
On the evidence presented, a jury could find that Gallo's unfair marketing strategies that targeted Kendall-Jackson's share of the premium wine market contributed to Kendall-Jackson's pursuit of the infringement action which, in turn, resulted in Gallo having to defend against Kendall-Jackson's unsuccessful allegations. A jury could find that Gallo's inequitable conduct occurred in the transaction related directly to the matter before the court  the marketing of Turning Leaf wine to compete with Vintner's Reserve wine  and affects the equitable relationship between the litigants.
Gallo argues the marketing practices that support the unclean hands defense were only tangentially at issue in, or indirectly *756 related to, the subject matter of the infringement action. Gallo finds Kendall-Jackson's unclean hands evidence analogous to that in Nutro Products, Inc. v. Cole Grain Co. (1992) 3 Cal.App.4th 860, 5 Cal.Rptr.2d 41.
In Nutro, the trial court granted a preliminary injunction for the plaintiff-maker of Nutro Max pet food enjoining defendant-competitor's sale of Nutrix pet food. The appellate court rejected the defendant's claim that the motion should have been denied because the plaintiff engaged in misleading advertising and thus had unclean hands. The trial court, if it believed there had been misleading advertising, could have found the misconduct did not bear a sufficient relationship to the trademark infringement claim to mandate a finding of preclusive unclean hands. (Nutro Products, Inc. v. Cole Grain Co., supra, 3 Cal.App.4th at p. 869, 5 Cal. Rptr.2d 41.)
Gallo contends that Nutro's misleading advertising clearly bore some relationship to the issue of likelihood of confusion which was an element of the trademark infringement case. Nevertheless the court concluded such conduct did not bear a sufficient relationship to the infringement case to justify a conclusion of unclean hands. Gallo reads too much into the court's brief discussion of the issue and ignores the different procedural posture of Nutro. The Nutro court did not describe the misleading advertising. The deception may have involved an attribute of the product that was completely unrelated to the likelihood of confusion issue. Further, the issue on review was whether the unclean hands conduct, as a matter of law, mandated denial of relief for the plaintiff. In contrast, the issue here is whether there is a triable issue of fact as to whether Gallo's unclean hands conduct relates directly to the infringement action or affects the equitable relations between the litigants. Nutro does not support Gallo's position that the unclean hands conduct, as a matter of law, is not related directly to the infringement action.
For all of the reasons set forth above, Gallo did not establish that its unclean hands conduct is not directly related to the "`transaction concerning which the complaint is made'" or does not affect the equitable relations between the parties as a matter of law. (Pond, supra, 151 Cal. App.3d at p. 290, 198 Cal.Rptr. 517.) Accordingly, Gallo failed to meet its statutory burden of proving its entitlement to judgment as a matter of law and was not entitled to summary adjudication. In light of that conclusion, we need not address Kendall-Jackson's contention that the trial court abused its discretion by denying the request for continuance pursuant to Code of Civil Procedure section 437c, subdivision (h).

DISPOSITION
Let a peremptory writ of mandate issue directing the trial court to vacate its order granting Gallo's motion for summary adjudication of Kendall-Jackson's unclean hands affirmative defense and to enter a new order denying the motion. The order to show cause is discharged and the stay of trial previously issued by this court is vacated.
Kendall-Jackson shall recovers its costs in this proceeding.
HARRIS, J., and BUCKLEY, J., concur.
NOTES
[1]  Gallo asks the court to take judicial notice of Kendall-Jackson's opposition to Gallo's motion to compel production of documents in which Kendall-Jackson concedes that probable cause is based on information known when the underlying complaint was filed. Gallo apparently wants to point out Kendall-Jackson's opposing positions. The request is denied. Kendall-Jackson's position is immaterial to whether there is a triable issue of fact regarding the unclean hands affirmative defense.
