Police have a man in custody after he allegedly fired shots into the air at the West Indian Day Parade before fleeing the scene in a cab.G.N. MIller/NY Post

At 6 a.m., a man was shot in the leg in a McDonald’s at 57 Empire Blvd in Brooklyn, and was in stable condition. (Theodore Parisienne)

Gunfire erupted today near the massive West Indian Day Parade in Brooklyn — not far from where Mayor Bloomberg was marching — as the entire city reeled from a epidemic of shootings over the past two days.

By noon today, a total of 46 people had been shot in the city since Saturday morning, authorities said.

At just before noon, a gunman fired into the air several blocks away from the start of the West Indian Day Parade route in Crown Heights before hopping into a cab and fleeing.

Bloomberg, who has decried the recent spate of gun violence, had just started marching.

Witnesses said the unidentified gunman got out of the car at E. 94th and Winthrop streets, and then ran off after tossing his gun. Cops caught him down the street after Macing him.

Police then washed the Mace out of his eyes with a carton of milk.

The frightening incident came as people around New York City continued being shot in a frenzy that began early Saturday morning.

Twenty five people had been shot as of 6 a.m. Sunday — including three kids at a house party-turned-shooting gallery in The Bronx early Sunday.

By early Monday morning, seven more people were shot in four separate incidents in Brooklyn — one of them fatally.

By noon, another seven people had been shot — bringing the shocking toll to 46 people injured by gunfire since Saturday morning.

In one incident today Tyrief Gary, 18, was fatally shot to the chest at 12:45 a.m. at 109 E. 54th Street in Brooklyn. Three others were shot during the same incident, all of whom were in stable condition at Kings County Hospital.

Police sources believe that three of the shootings this morning are connected to the pre-dawn festivities leading up to today’s West Indian Day parade.

The traditional celebration, known as J’ouvert, has been the scene of numerous shootings in the past, although cops have had it under control in recent years.

Separately, another man was shot in the chest today at 4:24 a.m. at Linden Blvd and Nostrand Avenue. He was in critical condition at Kings County Hospital

At 6 a.m., a man was shot in the leg in a McDonald’s at 57 Empire Blvd in Brooklyn, and was in stable condition at the same hospital.

At 11:48 a.m., a 41-year-old man was shot at 7th Avenue and W. 127th St. in Manhattan and taken to Harlem Hospital, where his condition was unknown. A 50-year-old man was in custody and being questioned.

Calling the chilling violence “just unconscionable,” Bloomberg demanded that the feds step up their efforts to get illegal weapons off the streets.

“We just cannot continue to have these guns in the hands of kids who don’t understand the value of human life,” he said.

The crime wave mirrored the city’s drug-fueled epidemic of violence in the 1980s and ’90s, police sources said.

“Last night was unbelievable,” one source said yesterday. “I can’t remember a couple of hours like these since the days of crack.”

A total of eight people alone were shot at 3:40 a.m. at the out-of-control house party on East 221st Street in The Bronx Sunday, authorities said.

The violence erupted after one man crashed the gig and then got into an argument with another male partygoer, sources said. Each opened fire on the other, spraying the panicked crowd with at least 21 bullets.

“I heard three shots, then a bunch more,” said a neighbor who asked that her name be withheld. “Then I heard people going over the fence and women screaming.”

Shaquan, his leg wrapped in white gauze, looked terrified as he whimpered to a reporter from his bed at Jacobi Hospital, “My foot hurts.”

Police apprehended one unidentified man suspected in the shooting, and were questioning him today.

They said they still are searching for 17-year-old Oneil DaSilva, of Mount Vernon, in connection with the shooting. His rap sheet includes nine arrests for attempted murder, third-degree assault and burglary.

The other two wounded kids were a 13-year-old girl hit in the left thigh and a 14-year-old girl shot in the back. Both were in stable condition last night.

Five men were also shot at the party. A 24-year-old victim, shot twice in the chest, was in critical condition.

The most gravely injured victim in the other shootings was a man shot on East 93rd Street in Brooklyn. He later died.