Two struggling pals (Johnson and Wayans) dress as police officers for a costume party and become neighborhood sensations. But when these newly-minted "heroes" get tangled in a real life web of mobsters and dirty detectives, they must put their fake badges on the line.

Employing a premise that was played far more seriously in Canadian filmmaker David Wellington’s 1993 feature, “I Love a Man in Uniform,” Greenfield and co-scripter Nicholas Thomas briskly establish the discontent of their two leads in the opening scenes. Ryan (Jake Johnson of TV’s “New Girl”), a former college football player who was sidetracked by injuries on his way to the NFL, feeds his bruised ego by coaching neighborhood kids – whether they want to be coached or not — when he isn’t half-heartedly pursuing a less-than-successful acting career. (His only major credit: a weirdly upbeat commercial for herpes medication.)

Justin (Damon Wayans Jr.), Ryan’s best buddy and roommate, is eager to make his mark as a videogame designer. But he slinks away in humiliation after co-workers and a snotty supervisor brutally shoot down his pitch for a new shooter game featuring L.A. cops. (His supervisor is more interested in zombies, superheroes and firefighters, though not necessarily in that order.)

Justin just happens to obtain authentic-looking police uniforms for the purposes of his pitch, and Ryan just happens to get the idea to don those uniforms for a college reunion he believes, mistakenly, is a costume party. The bad news: The buddies are made painfully aware of their 30-year-old-loser status while mingling with their much more successful former classmates. The good news: After the party, the friends discover that walking around L.A. — played throughout most of the movie, in a bold stroke of casting, by Atlanta — is a great way to get respect. And, not incidentally, attract women.

Ryan gets carried away with the thrill of their masquerade, and proceeds to up the ante — acquiring a decommissioned cop car on eBay, purchasing bullet-proof vests, etc. — much to Justin’s increasing discomfort. Mind you, Justin is quite happy to win the attention of Josie (Nina Dobrev), a beautiful waitress who wants to be a Hollywood makeup artist, with his imposture as a patrolman. But Ryan insists on throwing himself and his buddy into dangerous situations — including progressively edgier encounters with a Eurotrash mobster (James D’Arcy) and his crew — without backup by real cops, or even access to real guns.

Johnson is unafraid to emphasize the more obnoxious aspects of his character, even while obviously straining, with frequent success, to elicit hearty guffaws with Ryan’s bad behavior. The faux flatfoot isn’t always likable, to a large degree because, while “Let’s Be Cops” is a comedy, the audience is never unaware that Ryan is repeatedly, and stupidly, placing himself and his buddy in mortal danger. Still, Johnson always manages to retain some degree of sympathy, especially when Ryan’s fecklessness is contrasted with the effectively straight-faced villainy of D’Arcy’s crime boss.

Wayans gets the lion’s share of the physical-comedy action — and the aptly anxious reactions — and makes the most of the movie’s funniest scene, in which Justin goes undercover as a thug tricked out with tattoos, dreadlocks and shiny grill, and must cope with the aftereffects of sampling crystal meth.

“Let’s Be Cops” features scads of supporting players overplaying in broadly comic roles — Keegan-Michael Key is a standout as the English-mangling thug who inspires Justin’s undercover role playing — but Greenfield relies on the more restrained performances by D’Arcy and Rob Riggle (well cast as a real cop who proves to be an invaluable ally for the leads) to enhance the sense of threat that percolates beneath the zaniness. Andy Garcia also helps in that regard, but it would require spoiling one of the film’s few surprises to be more specific.

There are wink-wink, nod-nod references to various dead-serious (and not so serious) cops-and-killers thrillers, including an inspired allusion to, of all things, “Reservoir Dogs.” And even though some of the gags are brazenly non-P.C., the filmmakers are careful not to mine Justin’s use of a Chinese surname while play-acting for offensive ethnic humor. Indeed, when Justin takes his one and only crack at a comical Chinese accent, he immediately apologizes. No kidding.

Tech values are slick, and the many pop tunes on the soundtrack have been chosen with savvy. Be forewarned: After this movie and “This Is the End,” it appears possible the Backstreet Boys are poised for a comeback