Brooklyn 99 and New Girl are both iconic shows, so it only made sense to have a crossover between them, and here are which episodes to watch. At the time of the crossover, both Brooklyn 99 and New Girl were airing on Fox with New Girl in its later seasons as it had started two years before Brooklyn 99, in 2011. Brooklyn 99 and New Girl are set on opposite sides of the country, so the crossovers had to bring the New Girl ensemble to the East Coast to be able to merge them properly.
https://screenrant.com/brooklyn-99-new-girl-crossover-episodes-watch/