A vintage Porsche built nearly 50 years ago has a doppelganger — and the owners of both cars claim theirs is the real deal.

A racer and a collector are squaring off in Manhattan Federal Court over their competing rides, both 911 RSR prototypes.

Porsche built just eight of them in 1973.

Jacob Shalit, a California vintage race car driver, claims in a suit that in 2008 he bought the seventh one the company made and restored it.

Kenny Schachter, a classic car collector and art dealer, says he’s the owner of the genuine R7, as it’s called.

Shalit argues his attempts to sell his car are being scuttled because Schachter is peddling a fake.

Schachter, son-in-law of disgraced hedge funder Mark Rich, decried Shalit’s claims, insisting that Porsche mechanic Norbert Singer authenticated his car as the true R7, which once finished fourth at the Le Mans race in France.

Singer, “the Mick Jagger of car mechanics,” gave his approval while Shalit was sold “a box of pieces,” Schachter told The Post.