NEW YORK — With tennis history in the balance, an American wild card with an unimposing serve and unorthodox strokes put an early scare into world No. 1 Novak Djokovic on Monday night at the U.S. Open.

But with his pursuit of the calendar-year Grand Slam as his north star, Djokovic overcame an unsettled start against 20-year-old Jenson Brooksby to advance to the quarterfinals with a 1-6, 6-3, 6-2, 6-2 victory.

Brooksby’s defeat, in just under three hours, represents a grim milestone for American tennis: With his ouster, this is the first time in the history of the U.S. Open, which was first held in 1881, that no American man or woman advanced to the quarterfinals.

Before Brooksby stepped into Arthur Ashe Stadium to contest the night session’s first match, fellow American Reilly Opelka had fallen short in his bid to reach the quarterfinals, defeated in four sets by South Africa’s Lloyd Harris. And American Shelby Rogers was swept aside by British qualifier Emma Raducanu, 6-2, 6-1.

To subdue the 99th-ranked Brooksby, who turned pro only in January, Djokovic needed to summon virtually all of his prodigious weapons: relentless defense, potent service return, exceptional stamina and steely resolve.

Early in the contest, when victory seemed far from assured, the 34-year-old added a few piercing stare-downs at the youngster in case he had forgotten that his opponent was a 20-time Grand Slam champion on the cusp of staking a claim as the greatest in men’s tennis history.

“I wanted him to feel my presence on the court,” Djokovic explained afterward.

To claim a calendar-year Grand Slam, a player must win 28 consecutive matches in the four majors. Djokovic now has won 25 to claim this year’s Australian Open, French Open and Wimbledon and reach the U.S. Open quarterfinals. Three more would make him the first man since Rod Laver in 1969 to achieve the feat. His next hurdle comes in Wednesday’s quarterfinals, where he’ll face big-serving Matteo Berrettini of Italy in a reprise of the Wimbledon final.

If Djokovic wins the tournament, he would claim his 21st major, which would break his tie for the men’s record with Roger Federer and Rafael Nadal, who are not competing.

Until Djokovic managed to seize the momentum for good Monday, midway through the second set, Brooksby had the capacity crowd on its feet and cheering his retrieval skills (he is surprisingly fleet and agile for a 6-foot-4 player), his wickedly angled passing shots and his grit in breaking Djokovic’s serve during a marathon game in the second set that lasted 19 minutes.

ESPN’s broadcasters, Brad Gilbert and four-time U.S. Open champion John McEnroe, were so giddy about Brooksby’s potential that they spoke on air about strategies for helping him improve his serve.

Watching on TV, Andy Roddick — the most recent American man to win a Grand Slam, the 2003 U.S. Open — offered help via text and did his own gushing on social media, raving about Brooksby’s toughness and how fun he was to watch. He closed with a message to his wife: “Sorry @BrooklynDecker, but I think I love another.”

Brooksby drew the notice of college coaches and agents as a teen, when he toppled Tomas Berdych in the first round of the 2019 U.S. Open. He subsequently enrolled at Baylor but never played a match for the Bears during the 2020 season because of an injury.

In January, he abandoned his studies to turn pro and launched into a schedule cobbled together from second-tier Challenger events and ATP tournaments whenever he could qualify or get a wild card. He dominated the Challengers and earned respect in the ATP events, upsetting 15th-ranked Felix Auger-Aliassime in Washington’s Citi Open.

Monday night against Djokovic, Brooksby got off to a charmed start, bolting to a 3-0 lead on his own guile and some lax shots by the more seasoned Serb.

The two had never played each other. And though Djokovic had done a bit of homework on the young American’s tactics and tendencies, it took the Serb the full first set to figure out how to counter and attack.

Time and again, Djokovic underestimated Brooksby’s speed, attempting drop shots that the American chased down. He also underestimated Brooksby’s ability to predict where he was going with the ball. Unaccustomed to losing so many relatively straightforward points, Djokovic started overhitting, committing errors instead of winners.

Brooksby claimed the opening set in 29 minutes, and Djokovic retreated to his courtside chair to compose his thoughts.

“He’s a young, talented player that is very crafty,” Djokovic said. “He’s got the really all-around game. He was pumped. He had the crowd behind him, of course. He played a perfect first set. Everything he intended to do, he executed it perfectly.

“On my end, I was just trying to find a rhythm, trying to read his game, trying to understand where I can find holes in his game and start to attack and shift the momentum to my side.”

More from The Post: