Brooklyn Nine-Nine is an ensemble comedy about a talented-but-carefree detective, a by-the-book police captain and their precinct colleagues. While based in the workplace, Brooklyn Nine-Nine is not really about the job – it's about the men and women behind the badge.
Jake and Rosa assimilate to their new lives behind bars, but both are coping in very different ways. Jake bonds with his cellmate, Caleb, and is forced to join a prison gang led by notorious inmate Romero, in order to gain his protection. Meanwhile, in the women's prison, Rosa puts Holt and Terry to the test by having them complete outrageous favors for her. Back in the precinct, Amy and Charles are doing all they can to exonerate their colleagues.
When the warden asks Jake to investigate Romero's drug smuggling operation, Jake and Caleb find themselves caught between the loyalty Jake has sworn to both of them. Meanwhile, Amy is offered a deal by a local mobster who claims he can prove that Hawkins is guilty, but Holt and the rest of the gang think they have a safer plan.
Now that he's officially back at the precinct and desperate to solve a real case, Jake finds a loophole to get out of his temporarily designated desk duty. Unfortunately, that loophole rests on his ability to pass an official evaluation performed by Holt. While Charles provides Jake with moral support, Terry and Amy help Rosa, who believes Pimento may be cheating on her.
The Nine-Nine embarks on its fifth annual Halloween Heist and, as usual, everybody has a plan and no one is safe. Relationships and friendships are tested as the title "Amazing Human Slash Genius" must be snagged by midnight, leaving everyone pitted against each other.
To track down the infamous arms dealer Dan "Daniel" Valdano, Jake and Terry go undercover at an illegal gambling club, but when Holt gets involved to coach the two in the art of poker, his addiction resurfaces. Meanwhile, Boyle buys a food truck that was formerly used in a brutal string of murders without telling his investor, Amy, and Hitchcock and Scully challenge Rosa to a "Butt-lympics".