
550 S.E.2d 822 (2001)
Mark WHITTAKER, Petitioner,
v.
FURNITURE FACTORY OUTLET SHOPS and Auto Owners Insurance Company, Respondents.
No. COA00-777.
Court of Appeals of North Carolina.
July 17, 2001.
*823 DeVore, Acton & Stafford, PA, by Troy J. Stafford, Charlotte, for petitioner-appellee.
Dean & Gibson, L.L.P., by Rodney Dean and Colin E. Scott, Charlotte, for respondent-appellant.
TYSON, Judge.

I. Facts
Mark Whittaker ("petitioner") acquired a 1987 Harley Davidson motorcycle ("motorcycle") in 1994 for $12,000.00. The motorcycle was titled in his name. The motorcycle was registered with the Division of Motor Vehicles and driven on the public roads and highways until on or about Christmas Day of 1996. Petitioner's wife gave him a new Harley Davidson motorcycle for Christmas. After Christmas 1996, petitioner did not operate the 1987 motorcycle on the road and allowed the registration to expire in 1997. Registration for the motorcycle was never renewed. Instead, petitioner customized and restored the motorcycle at a cost of $8,133.35 and used it exclusively as a "show bike." During 1997 and 1998, the motorcycle was entered in at least three different motorcycle shows.
On or about 7 November 1998, petitioner loaned the motorcycle to Furniture Factory Outlet Shops ("Furniture Factory") to be used as a display in their Hickory, North Carolina store to help attract business. On or about 13 November 1998, the motorcycle was stolen from the premises of Furniture Factory and has not been recovered.
Auto-Owners Insurance Company ("respondent") issued an insurance policy to Furniture Factory, effective 25 May 1998. The policy provides Business Personal Property coverage for the Furniture Factory store. After the theft, petitioner made a claim for the loss of the motorcycle. Respondent denied the claim, citing an exclusionary clause to the policy within Section A subsection 2(a) which excludes "aircraft, automobiles, and other vehicles subject to motor vehicle registration."
On 25 March 1999, petitioner filed a verified petition for Declaratory Judgment against Furniture Factory and respondent alleging that the loss was covered under the policy. On 7 June 1999 respondent filed an Answer and Counterclaim citing the exclusionary clause in the policy. Furniture Factory filed a motion to dismiss on 27 March 2000. On 28 March 2000, petitioner filed a Notice of Voluntary Dismissal without prejudice as to Furniture Factory.
On 30 March 2000, the Honorable Timothy S. Kincaid heard the matter and on 4 April 2000 entered an order concluding that petitioner's motorcycle was not "subject to motor vehicle registration" and therefore was a loss covered by the insurance policy issued by respondent to Furniture Factory at a replacement value of $20,133.35. Respondent appeals.


*824 B. Issues

Respondent brings three issues on appeal to this Court: (1) whether a motorcycle used as a show bike is "subject to motor vehicle registration" and therefore not covered under the insurance policy issued by respondent; (2) whether petitioner, as a third party to the insurance policy, is covered when petitioner's interpretation of the policy conflicts with that of parties to the contract, the insurer and the insured; and (3) whether petitioner is entitled to any recovery assuming petitioner's loss is found to be covered under the policy.

II. Subject Matter Jurisdiction

A. "Person Interested"
Respondent argues that petitioner is a third party to its insurance policy with its insured, Furniture Factory and has no privity to the contract. Additionally, respondent argues that petitioner has not established legal liability on the part of Furniture Factory to petitioner. As a result, respondent requests for the case to be dismissed. We agree.
"A challenge to ... subject matter jurisdiction may be made at any time." In re Spivey, 345 N.C. 404, 409, 480 S.E.2d 693, 695 (1997)(citing Askew v. Leonard Tire Co., 264 N.C. 168, 171, 141 S.E.2d 280, 282 (1965)). The issue may be raised by the appellate court on its own motion, even when not raised by the parties. Bache Halsey Stuart, Inc. v. Hunsucker, 38 N.C.App. 414, 421, 248 S.E.2d 567, 571 (1978), disc. review denied, 296 N.C. 583, 254 S.E.2d 32 (1979)(citing Jenkins v. Winecoff, 267 N.C. 639, 148 S.E.2d 577 (1966)).
N.C. Gen.Stat. § 1-253 et seq., the Declaratory Judgment Act, provides: "[c]ourts of record within their respective jurisdictions shall have power to declare rights, status, and other legal relations, whether or not further relief is or could be claimed." Before a declaratory judgment action is cognizable, our case law requires that "an actual controversy between the parties [exists as a] jurisdictional prerequisite to an action." Sharpe v. Park Newspapers, 317 N.C. 579, 583, 347 S.E.2d 25, 29 (1986)(citing Gaston Bd. of Realtors v. Harrison, 311 N.C. 230, 234, 316 S.E.2d 59, 61 (1984)). Additionally, parties cannot by agreement or stipulation, confer subject matter jurisdiction upon a court by consent. McLaughlin v. Martin, 92 N.C.App. 368, 370, 374 S.E.2d 455, 456 (1988)(citing City of Raleigh v. Norfolk S. Ry. Co., 275 N.C. 454, 464, 168 S.E.2d 389, 396 (1969)).
N.C. Gen.Stat. § 1-254 sets forth the following criteria as to what persons are entitled to declaratory relief:
Any person interested under a deed, will, written contract or other writings constituting a contract, or whose rights, status or other legal relations are affected by a statute, municipal ordinance, contract or franchise, may have determined any question of construction or validity arising under the instrument, statute, ordinance, contract, or franchise, and obtain a declaration of rights, status, or other legal relations...,
whether or not further relief is or could be claimed. N.C. Gen.Stat. § 1-254 (1999) (emphasis supplied). The provision "any person interested under a deed, will, written contract or other writings constituting a contract" has been interpreted by our Court to allow a party to a contract or a direct beneficiary to have standing under N.C. Gen.Stat. § 1-254 to file a declaratory judgment action under N.C. Gen.Stat. § 1-253. Parties with proper standing enable the court to have subject matter jurisdiction over the case in controversy. See W & J Rives, Inc. v. Kemper Ins. Group, 92 N.C.App. 313, 320, 374 S.E.2d 430, 434 (1988); Matter of Calhoun's Will, 47 N.C.App. 472, 267 S.E.2d 385 (1980). "Absent an enforceable contract right, an action for declaratory relief to construe or apply a contract will not lie." Terrell v. Lawyers Mut. Liab. Ins. Co., 131 N.C.App. 655, 661, 507 S.E.2d 923, 926 (1998). There is an exception which allows a plaintiff to file a declaratory judgment action directly against the insured. A third party through underinsured motorist coverage has a direct benefit through subrogation to a contract. See Church v. Allstate Ins. Co., 143 N.C.App. 458, 547 S.E.2d 458 (2001). The reason for this exception is G.S. § 20-279.21(b)(4) which *825 allows an underinsured motorist insurer, upon receipt of notice, to have "the right to appear in defense of the claim without being named as a party therein, and without being named as a party ... [to] participate in the suit as fully as if it were a party." Id. In the present case, petitioner is not a "person interested... under a written contract or other writings constituting a contract." N.C. Gen.Stat. § 1-254 (1999).

B. "Rights, Status Or Other Legal Relations"
The second way to achieve standing through N.C. Gen.Stat. § 1-254 is to be a third party who has "rights, status or other legal relations [that] are affected by statute, municipal ordinance, contract or franchise." N.C. Gen.Stat. § 1-254 (1983). When a person is a third party to a contract, "standing to seek a declaration as to the extent of coverage under an insurance policy requires that the party seeking relief have an enforceable contractual right under the insurance agreement." DeMent v. Nationwide Mutual Ins. Co., 142 N.C.App. 598, 601, 544 S.E.2d 797, 799 (2001)(citing Terrell v. Lawyers Mut. Liab. Ins. Co., 131 N.C.App. 655, 507 S.E.2d 923 (1998)).
To ascertain whether an "enforceable contractual right" exists, the court in DeMent looked to the intent of the contracting parties. Id. at 799 (citing Raritan River Steel Co. v. Cherry, Bekaert & Holland, 329 N.C. 646, 407 S.E.2d 178 (1991)). The court concluded that if the declaration is in an insurance policy that payment be made "on behalf of an insured," then the obligation of an insurer to pay a third party flows "primarily and directly to the insured." Id. at 801. In such a circumstance, "[b]ecause the benefit running to plaintiff by reason of the provision is merely incidental, he is without standing as a third party beneficiary to seek enforcement of the covenant or a declaratory judgment as to its terms." Id. at 801; see Terrell, 131 N.C.App. at 660, 507 S.E.2d at 926. The court in DeMent concluded that an automobile accident victim could not bring an action directly against tort-feasor's liability insurer for a declaratory judgment because the accident victim's claim was merely incidental to the insurance policy, and plaintiff's claim against the insured tort-feasor had not been established as an enforceable contractual right. Id.
Also, in McLaughlin v. Martin, 92 N.C.App. 368, 369, 374 S.E.2d 455, 456 (1988), there was no case in controversy to meet the jurisdictional requirements for declaratory judgment under N.C. Gen.Stat. § 1-253. Plaintiff had not obtained a judgment determining the liability of the defendant's uninsured motorist coverage, and there was no assurance that they ever would do so. Id. at 369, 374 S.E.2d at 456. Without a judgment, plaintiff cannot establish a "right" to recover and liability of the insured does not attach. Id. at 369, 374 S.E.2d at 456.

C. Rule 17(a)
G.S. § 1A-1, Rule 17(a) of the North Carolina Rules of Civil Procedure provides that every claim shall be prosecuted or defended in the name of the real party in interest. Reliance Ins. Co. v. Walker, 33 N.C.App. 15, 18, 234 S.E.2d 206, 209 (1977). "The real party in interest is the party who by substantive law has the legal right to enforce the claim in question." Id. at 19, 234 S.E.2d at 209 (citing White Hall Bldg. Corp. v. Profexray Division of Litton, Industries, Inc., 387 F.Supp. 1202 (E.D.Penn.1974)). More specifically, a real party in interest is "... a party who is benefitted or injured by the judgment in the case." Id. at 18, 234 S.E.2d at 209 (quoting Parnell v. Ins. Co., 263 N.C. 445, 448-49, 139 S.E.2d 723, 726 (1965)).
In this case, respondent's policy that was issued to Furniture Factory contains "the Businessowners Specialty Property Coverage Form Section A(b)(2)." The policy provides coverage of the "property of others that is in your care, custody or control; but this property is not covered for more than the amount for which you are legally liable ..." Petitioner has not established the legal liability of Furniture Factory for his loss. No "rights" of petitioner under N.C. Gen.Stat. § 1-254 exist to establish a case in controversy to meet the jurisdictional requirements for declaratory judgment under Sec. 1-253. As in DeMent, the petitioner *826 in this case is an incidental beneficiary to the insurance policy, and does not have a contractual "right" under N.C. Gen.Stat. § 1-253, and therefore, does not have standing. Additionally, under N.C. R. Civ. P. Rule 17(a), the petitioner is required to have a legal right to enforce the claim in question. Without a judgment against Furniture Factory, petitioner does not have an enforceable contractual right under the insurance policy. As a result, petitioner does not have standing to bring this action directly against respondent.
Accordingly, we dismiss this action for lack of subject matter jurisdiction. Our holding is without prejudice to petitioner to bring subsequent action against respondent in the event that petitioner establishes liability against Furniture Factory and reduces its claim to judgment.
Appeal dismissed.
Judges WALKER and HUNTER concur.
