A feisty NSW P-Plater has been handed some tough love over the weekend after inadvertently duelling an undercover cop in a drag race before being pulled over in a blaze of red-and-blue lights.

The provisional license holder, driving a sporty white hatchback, sits next to an unmarked green Holden at an intersection in Sydney's west, in footage posted to Dash Cam Owners Australia.

As the light turns green, the white hatchback fangs it down a double-lane road, which has a speed limit of 70km/h, steadfastly refusing to let the Holden move ahead of it.

Both vehicles whip off into the distance, before the driver who recorded the face-off rounds a corner and rises over a hill to see the Holden, police lights now flashing, parked behind the hatchback.

The actions of the police officer were blasted by many commenters on the Dash Cam Owners Australia Facebook as entrapment.

"Putting on your lights after losing is just bad sportsmanship," claimed Daniel Rath.

But observant viewers picked out the police aerials on the Holden, saying: "how dumb can you get?"