Although they reprimanded him off for the potentially dangerous stunt, the two police officers let Louis go with just a warning, but they insisted on getting a photograph with him and Niall, 19, before letting them drive away.
A source told The Sun newspaper: "Louis and the boys are having a great time in the 'Big Apple' and want to capture every minute.
"Louis was only standing through the sun roof momentarily but it was long enough to catch the eye of the cops.
"He may have found it funny but motorists stuck in a traffic jam certainly didn't."
It is thought Louis was filming for the group's 3D film next year, which is set to be a similar style to Justin Bieber's 'Never Say Never'.
One Direction played the biggest concert of their career so far when they performed for 20,000 fans at Madison Square Garden on Monday.
The British boy band - which also includes Zayn Malik, Liam Payne and Harry Styles - are set to return to the historic venue today (07.12.12) to play Z100's Jingle Ball 2012, which also features Ed Sheeran and rival group The Wanted.