Gangs of New York is based on, or rather inspired by, journalist Herbert Asbury’s 1928 book of the same name. It was one of Martin Scorsese’s many long-running passion projects, and he allegedly spent over 20 years developing his ideas and then finally filming it. Scorsese was drawn to the criminal underworld of the 19th century, a subject often ignored in favor of the Old West or the wider political movements and conflicts such as the Civil War. He saw a real conflict over the direction of the country. The director was ultimately unsatisfied with the final product, as producer Harvey Weinstein forced cuts (Scorsese is known for his looong running times). Weinstein also oversaw the addition of voiceover narration by Leonardo DiCaprio which is often unnecessary.
Still, this is probably the only major film to touch on a lot of aspects of 19th Century urban life and was intended as a springboard for a new subgenre of crime and historical films (it was not to be). Scorsese really wanted to show the breadth of 19th Century New York, so there are anachronisms. The movie is clearly set in 1862-1863, the Civil War being a major background event that eventually intrudes on the characters’ gang war. However, the Nativist movement was much stronger in the 1850s. While immigration was still a major social and political issue, the organized Nativists, expressed by the Native American Party, lost their steam as the sectional conflict took over. On the opposite end, Boss Tweed and his powerful and corrupt Tammany Hall Democrat machine didn’t kick into gear until after the Civil War. Here he’s a major player from the get-go, played by Jim Broadbent.