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".
The always unwelcome Vulture pops back into Jake and Amy's lives, threatening to swoop in and take something important away from them. Meanwhile, Boyle and Rosa must track down "Sergeant Peanut Butter," the kidnapped NYPD horse that Charles envies, and Holt challenges Terry to be less image-conscious.
Jake and Amy attempt to get their parents to bond over Thanksgiving dinner, but their first holiday together as a family does not go well. Meanwhile, at the precinct, Holt and Kevin's special Thanksgiving pie is stolen from his office and Holt searches through the ranks for the possible culprit.
When Terry's favorite author, DC Parlov, returns to the precinct because his latest manuscript was stolen, Terry and Jake convince Rosa to go undercover with them at a fantasy fiction convention to find the culprit. As drama ensues between Parlov and another writer, Terry admits that he's been writing a book of his own. Back at the precinct, Holt, Amy and Charles take a forensics course, but Charles' big mouth gets him in trouble.
While the entire precinct attends a funeral in LA, Holt learns that he is in the running to become Chief Commissioner of the NYPD - his dream job. But after missing their flight back to New York, Jake must devise a variety of ways to get Holt back in time for the interview. Forced to stay with some estranged members of the Boyle family, Amy tries to convince everyone that she can be laid back, Terry panics about losing his first-class flight and Charles uncovers some new information about Rosa's personal life.
Rosa begs Jake to help her break some big news to her parents, but her plan is thrown off when they wrongly assume the two are dating. Then, when Seamus Murphy returns to redeem the favor Holt owes him, the precinct searches for a loophole that will allow Holt to uphold his end of the bargain without breaking the law.