Whilst in the diner Roger asks Barnes if he trained this "Mr. Joshua", which is a nod to Lethal Weapon (1987). Mr. Joshua (played by Gary Busey) was the mercenary that attacked Martin Riggs(Mel Gibson).
At the end Scorsese calls out the gun Gutierrez has in the police office, charges her, and ends up getting flipped onto his back. This mimics a similar interaction when Murtaugh is first introduced to Riggs in the first Lethal Weapon movie.
The production code was T13.21306.