A 24-year-old man was shot to death early Sunday in a Brooklyn apartment building lobby just a block away from where a man’s dismembered body was found two days earlier.

The shooting victim was blasted in the torso in the lobby of a building on Dorchester Road near E. 21st St. in Flatbush after police received a call of two men involved in a dispute about 2 a.m., officials said.

Medics rushed the victim to to Kings County Hospital but he could not be saved. His name was not immediately released.

Police took a person of interest into custody but no charges were immediately filed.

The shooting happened just around the corner from where police found a man’s hacked up body in a blue trash bin on E. 21st St. near Ditmas Ave.  Friday morning. Family members identified the man as Darrell Montgomery, 33.

The fatal shooting is not believed to be related to Montgomery’s death, a police spokeswoman said Sunday.