Djokovic, looking to become the first player to capture 25 Grand Slam titles, capped the evening session under the lights of Arthur Ashe Stadium with a 6-2 6-2 6-4 victory over Moldovan qualifier Radu Albot.
The Serbian world number two had not competed since winning the Olympic gold medal in Paris and shook off the rust to cruise past Albot in his bid to become the first man to retain the New York title since Roger Federer in 2008.
He also set a record for most victories by a male player at the main showcourt with his 78th win.
"I wasn't aware of it to be honest," Djokovic said.
"It's the biggest stadium. Definitely the loudest we have in the history of our sport. The night sessions are the best in the world on Arthur Ashe.
"Ever since the roof was introduced it became even louder. Electric atmosphere ... we're clocking midnight now. I love night sessions, maybe not this late but it was great fun."
Gauff cruised past France's Varvara Gracheva 6-2 6-0 on Ashe as the American shrugged off disappointing performances in Toronto and Cincinnati to make a fast start at the year's final major.
"The last couple of weeks were tough and I was like, 'I have to do this and do that' but I don't have to prove anything to anyone except myself," Gauff said.
"This whole week or two weeks are just about proving all the expectations that I have on myself."
It was the end of the road for Thiem, who is retiring at the end of the season due to a wrist issue that derailed his career, as the 2020 champion fell 6-4 6-2 6-2 to American Ben Shelton.
Diego Schwartzman also waved goodbye to Flushing Meadows after the Argentine's final appearance at the tournament ended with a 6-7(2) 6-2 6-2 6-1 loss to Frenchman Gael Monfils.
Fourth seed Alexander Zverev, who lost the final to Thiem four years ago, began his latest bid to lift a first major title with a 6-2 6-7(5) 6-3 6-2 win over fellow German Maximilian Marterer.
Taylor Fritz flew past Argentine Camilo Ugo Carabelli 7-5 6-1 6-2 as he launched his quest to become the first American man to win a Grand Slam title since Andy Roddick triumphed at the 2003 U.S. Open.
He was joined in the second round by Cincinnati runner-up Frances Tiafoe after the 20th seed battled past fellow American Aleksandar Kovacevic 6-4 6-3 4-6 7-5.
Denmark's Holger Rune was an early casualty, the 15th seed sent packing by American Brandon Nakashima 6-2 6-1 6-4, while Casper Ruud of Norway dispatched Bu Yunchaokete 7-6(2) 6-2 6-2.
Second seed Aryna Sabalenka, the Australian Open champion and one of the pre-tournament favourites, shone under the lights as she beat Australian Priscilla Hon 6-3 6-3.
Last year's runner-up arrived in New York fresh off her triumph in Cincinnati and is looking to become the first woman to capture the season's two hardcourt majors in the same year since Angelique Kerber in 2016.
China's Olympic champion Zheng Qinwen kicked off the matches on Louis Armstrong Stadium with a 4-6 6-4 6-2 victory over Amanda Anisimova, while her compatriot Wang Yafan advanced after ninth seed Maria Sakkari retired with injury trailing 6-2.
Frenchwoman Clara Burel recovered from being blanked in the opening set to beat 2017 champion Sloane Stephens 0-6 7-5 7-5.
Wimbledon champion Barbora Krejcikova and three-times US Open runner-up Victoria Azarenka joined seeded players Madison Keys, Paula Badosa and Elina Svitolina in advancing in the women's draw.
Rusty Djokovic kicks off Grand Slam record bid with Albot thrashing
Novak Djokovic's bid for a record 25th Grand Slam title kicked off on Monday with a rusty 6-2 6-2 6-4 win over qualifier Radu Albot in the US Open first round as the defending champion returned to the court after his Olympic triumph.
Three weeks after winning the singles title at the Paris Games, Djokovic toted his rackets and gear in a pair of gold-coloured bags onto centre court where the Arthur Ashe Stadium crowd gave him a hero's welcome.
But the Serb's golden touch was decidedly lacking in the late night match as he struggled with serve and racked up nearly twice as many unforced errors as winners.
For all that, he had more than enough weapons to handle Moldovan Albot in their first tour clash and claim a record 78th win at Arthur Ashe under a closed roof.
"I was not aware of it, to be honest with you," Djokovic said of the centre court milestone.
"It's definitely the loudest stadium we have in the history of our sport. The night sessions are the best in the world here."
While having never played Albot before, Djokovic said he had done his homework on the 34-year-old who beat both his younger brothers Marko and Djordje during their playing days.
"They both lost to him so hopefully I can avenge my brothers tonight," he told ESPN commentator Brad Gilbert with a laugh before taking the court.
Djokovic duly avenged the family name in three clunky sets but he will hope for better from his game as he looks to move past Margaret Court on the all-time Grand Slam winners' list.
With 10 double-faults, his serve was wild by his usual standards, and he winced throughout the night as 40 unforced errors piled up.
His coach Nenad Zimonjic was an animated presence, barking instructions in Serbian at the wayward champion, who could convert only six out of 16 break points.
Though Djokovic was well off his best, Albot was unable to make the world number two pay.
After bright starts in the first two sets, he crumbled on serve in each of them before making a better game of the third.
In the twilight of a record-smashing career, Djokovic is eyeing several milestones in New York, including a fifth title at Flushing Meadows to match the professional era record held by Pete Sampras, Jimmy Connors and Roger Federer.
He also hopes to become the first back-to-back winner in the men's singles since Federer's run of five successive titles from 2004-08.
--Reuters--