NYPD Detective's Javier Esposito (Jon Huertas) and Kevin Ryan (Seamus Dever) use a Glock 17 as their primary sidearms throughout the series. Criminals also like them, one was used with a suppressor to murder Roger Farraday (Dean Cates) in A Deadly Game (S2E24).
A Glock 26 serves as Det. Beckett's backup gun, it's most notably seen when she hands it to Castle to defend himself from the "Tick, Tick, Tick..." & "Boom!" killer when they enter the warehouse he's hiding in. He uses it to shoot Kate's Glock 19 out of the killers hand. After wards Castle reveals that "he was aiming for his head".
Noteworthy is that his "Aiming for the head" remark is the third Firefly/Serenity reference in the series. The first two took place during the episode "Vampire Weekend" when Castle wore his Mal costume, and the second was a catalyst sitting on his bookshelf. A catalyst is required for any Firefly class ship to run, and was a large part of Out of Gas' story arc.
In "The Third Man" (S2E14), Noel du Preez (Michael Enright) uses a compensated M1911-type to shoot at the team when he thinks they're robbers stealing from his store. Former NYPD officer, and Esposito's former partner Ike Thornton (Aaron D. Spears) is seen with a 1911 during in "Den of Thieves" (S2E21), off camera Esposito uses it to wound dirty Lt. Holliwell.
The killer uses a Ruger P90 during his activities in "Boom!" (S2E18). FBI Special Agent Jordan Shaw (Dana Delany) briefly uses it near the end of the same episode.
NYPD officers are occasionally carrying the SIG-Sauer P226 (in reality, this weapon is not authorized by the NYPD to carry onduty). After disarming an officer, Rathborne holds Castle hostage with one in "Sucker Punch" (S2E13).
Castle (Nathan Fillion) is briefly seen dressed in a costume deliberately similar to that worn by Captain Malcolm "Mal" Reynolds in the series Firefly (Fillion's former television series). Castle is even seen wielding the modified Taurus 85 when trying his Mal costume on during the opening sequence of "Vampire Weekend" (S2E06). In Firefly, the revolver was known as a "Moses Brothers Self-Defense Engine Frontier Model B".
An Heckler & Koch MP5A4 with a weaponlight, and Navy trigger group was used by a drug dealer while stealing a victim's body in Season 2's premiere "Deep in Death" (S2E01).
During the events of "A Deadly Game" (S2E24), an MP5K is found in the car of Roger Farraday (Dean Cates). It was issued to him as part of a "spycation" where Farraday, under the guise of CIA hitman Sean Caldwell, was supposed to "assassinate" a foreign minister with it.
Esposito (Jon Huertas), as well as most NYPD ESU officers use M4A1's when needed. FBI HRT agents can be seen wielding both M4A1's and HK416's during "Tick, Tick, Tick..." (S2E17) and "Boom!" (S2E18).
In "Vampire Weekend" (S2E06), Esposito (Jon Huertas) is seen carrying an MGC M16 replica fitted with an M203 grenade launcher during Castle's Halloween party while dressed up as a US Marine (an in-joke as Huertas portrayed US Marine Sgt. Antonio Espera in the HBO miniseries Generation Kill).