New York State and its large haul of electoral votes carried Abraham Lincoln to victory in 1860 and 1864. But things were rather different in New York City. Though he had powerful Republican allies there — such as Horace Greeley, the influential editor of the New York Tribune — Lincoln hatred thrived in this largely pro-Southern town, whose economy was threaded through the clothes on New Yorkers’ backs. Southern cotton, grown on plantations financed by Wall Street banks, flowed in and out the city’s port, which was also a major entrepôt in the international slave trade.

The coming of war would polarize and divide the city like no other event in its history. In his lively new history of Gotham during the Civil War, John Strausbaugh (“The Village”) chronicles the tumultuous passions of New Yorkers during a conflict that would claim more American lives than any other.

At its best, “City of Sedition” forces readers to look past facile generalizations: North vs. South; free vs. slave; Union vs. Confederate. New York contained multitudes. “No city would be more of a help to Lincoln and the Union war effort, or more of a hindrance,” Strausbaugh writes. “No city raised more men, money, and materiel for the war, and no city raised more hell against it. It would be a city of patriots, war heroes and abolitionists, and simultaneously a city of anti-war protests, draft resistance and sedition.”

Episodic (often frustratingly so) and written on a truly vast canvas, Strausbaugh’s account teems with famous names — Herman Melville, struggling and in search of a government job; Walt Whitman, who ministered to Union wounded; Lincoln-loathing John Wilkes Booth and his famed actor brother, the Lincoln-loving Edwin — and many lesser-known figures. Strausbaugh writes with enviable zip and has a zest for (too many) details.

The author devotes the book’s first third to laying out New York’s antebellum history, so you’ll have to wait a while for the war itself. He looks at the emergence of the popular press; the influx of Irish, German and Italian immigrants; and the growth of the Tammany Hall Democratic political machine, which would both denounce the war and exploit for it vast gain.

Once the fighting broke out, New York initially closed ranks in defense of the Union. Strausbaugh has fun with the exploits of Democratic pol-turned-general Dan Sickles, who ran up a tab at Delmonico’s restaurant on the government dime. War spending created a brisk business environment that more than made up for the loss of Southern cotton markets, creating a whole new class of the rich known as the “shoddy aristocracy.”

advertisement | advertise on newsday

Immigrants looked to prove their patriotic mettle. The Irish flocked to the Union cause, raising brigades and fighting hard at Bull Run in 1861. Indeed, Sligo-born Michael Corcoran, who led the 69th New York Volunteers, was “one of the scant handful of officers the North could claim as heroes” of this ignominious Union setback. Other city units shone, too: The red-pantalooned Brooklynites of the 14th Regiment — the Fire Zoaves — so impressed Confederate general Stonewall Jackson that he dubbed them “red-legged devils.”

But the hand-wringing after the battle offered a foretaste of worse to come, The anti-Lincoln press seethed, impugning the war, abolitionists and blacks. The government cracked down, even jailing some editors for sedition, including the controversial James McMaster of the Catholic Freeman’s Journal, who was imprisoned on Fort Lafayette in the waters off Brooklyn.

As the battlefield slaughter increased — Irish ranks were decimated — and Northern war aims morphed from preserving the Union into a crusade to free the slaves, many soldiers were in a state of near revolt. “I did not come out to fight for the . . . abolition of slavery”, a colonel in the 3rd New York Infantry wrote his brother.

Things boiled over in 1863, when a draft was called. Peace Democrats, known as Copperheads, staged huge protests in Union Square. Workers, fearful of free blacks taking their jobs, erupted that July in the worst riots in New York history. Strausbaugh’s account is chilling, even if he can’t help but admire how Tammany engineered a profitable draft-dodging scheme in the riot’s aftermath.

Against all this, including an 1864 Confederate plot to burn the city down, New York and the Union held. “City of Sedition” is a potent reminder of just how close a thing the Union victory was.