French Open champion Swiatek recovered from a set and a break down to see off her 108th-ranked German opponent, 2-6, 6-4, 6-0.
Top seeded Swiatek will face US eighth seed Jessica Pegula for a place in the semifinals.
In a mistake-riddled clash on Louis Armstrong Court, there were a total of 15 double faults, 12 breaks of serve and 76 unforced errors.
"It's really satisfying. This is my first quarterfinal in New York so I am really proud of it," said Swiatek.
Wimbledon quarterfinalist Niemeier hadn't won a hardcourt match in her career before coming to New York.
However, she went into Monday's match not having dropped a set and fired up to repeat her Wimbledon journey where she had also beaten world No 2 Anett Kontaveit.
The 23-year-old from Dortmund swept through the opener with breaks in the first and seventh games.
She held her nerve in an eight-minute second game of the second set, saving two break points.
Niemeier sensed a shock victory when she broke for 2-1 but Swiatek eventually prevailed, taking a set which featured seven breaks of serve in 10 games.
In the decider, the Pole raced to a 4-0 lead with the powerfully-built Niemeier only winning five points.
Moments later Swiatek completed victory with her 19th 'bagel' set of the season to wrap up a place in a third Grand Slam quarterfinal of 2022.
Swiatek said her success in 2022 has been helped by her rigid loyalty to her walk-on play list which includes AC/DC, Led Zeppelin and Pearl Jam.
"I have been listening to it all year and I am pretty bored with it," she said. "But I am not going to change now."