French qualifier Barrere and US veteran Isner were forced indoors by the adverse weather threat in New Zealand, with the entire Tuesday schedule taking place on inside courts and without spectators.
Despite Isner rifling down 28 aces to move 10 away from becoming the first man to post 14,000 in ATP tour and grand slam events, Barrere stuck with him and pulled off a 6-7 (3-7) 7-6 (7-5) 6-3 victory.
He snatched the only break of the match in game eight of the deciding set, before serving out for victory, with the world number 88 firing down 10 aces himself across the contest.
Argentine seventh seed Sebastian Baez also fell at the last-32 stage, bowing out 7-6 (7-1) 6-1 to American wildcard Ben Shelton.
Serbian Laslo Djere set up a second-round clash with top seed Casper Ruud by edging out Spain's Jaume Munar 3-6 6-1 7-6 (7-4), while Czech Jiri Lehecka will face second seed Cameron Norrie next after sinking Brazilian fellow qualifier Thiago Monteiro 6-3 7-5.
Ruud and Norrie received first-round byes.
At Adelaide International 2, American eighth seed Tommy Paul battled past Australian Christopher O'Connell 6-4 7-5, setting up an appetising second-round clash with Britain's Jack Draper, who won through on Monday.
There was a home success for the Australian crowd to cheer, though, as qualifier John Millman, who beat Roger Federer at the 2018 US Open, this time dug deep for a 4-6 6-3 7-6 (8-6) win against Spain's Albert Ramos-Vinolas.
Djokovic, who is celebrating a record 378th week as world number one, had to rely on a third-set tie-break to finally get over the line, defeating his Czech opponent 6-3 3-6 7-6 (7-1) on Tuesday.
Machac is ranked 130th in the world, but caused Djokovic plenty of problems, earning 10 break points across the match, though he was only able to convert three.
Djokovic had a 4-1 lead in the deciding set before Machac fought back to force a tie-break, but the Australian Open champion ultimately had few problems at 6-6 as he won seven of the eight points played to clinch the win.
"Tomas certainly didn't play like the No. 130 in the world today," Djokovic said of his opponent. "He was giving me all kinds of trouble. But I guess when it mattered, I found another gear."
Djokovic, who is still undefeated in 2023, will face Tallon Griekspoor in the second round.
Elsewhere, fresh off two titles in as many weeks, third seed Daniil Medvedev eased past Matteo Arnaldi 6-4 6-2 to tee up a tie with Alexander Bublik next after his opponent Alexandar Lazarov retired hurt with Bublik leading 6-1 1-0.
Felix Auger-Aliassime defeated Maxime Cressy 7-6 (7-4) 3-6 6-3, but sixth seed Karen Khachanov is out after he was beaten 7-5 6-2 by Botic van de Zandschulp.
The Dutchman will take on Mikael Ymer in the second round after his 6-2 6-3 win against Francesco Passaro, while eighth seed Borna Coric and Dan Evans played just four games before the latter retired hurt.
Christopher O'Connell set up a match against Alexander Zverev in the next round after he overcame Emil Ruusuvuori 7-5 6-4.
Fritz, who reached last week's Los Cabos Open semi-finals and is currently ranked 36th in the world, edged out Opelka 7-6 (7-5) 6-7 (3-7) 7-6 (7-4) in just under three hours.
The pair sent down a combined 48 aces, with Fritz claiming 25 of them, with all sets going to tiebreakers, with no breaks of serve.
Third seed Cameron Norrie was bundled out by Finnish world number 78 Emil Ruusuvuori in straight sets.
Norrie, who won last week's Los Cabos Open for his maiden ATP Tour title, was beaten 7-6 (7-1) 6-3 by the Finn.
Ruusuvuori will take on teenager Brandon Nakashima in the semi-finals, after the American – who was runner-up to Norrie in Los Cabos - beat Jordan Thompson 7-6 (7-5) 7-5.
Sixth seed John Isner sent down 30 aces as he got past Australian qualifier Chris O'Connell 7-6 (7-5) 6-7 (3-7) 6-4.
World number two Medvedev was making his first appearance since March after undergoing a hernia operation and fell to a 6-2 7-6 (7-5) defeat.
The Russian's rustiness was clear in the last-16 tussle as he racked up seven double faults and struggled to make inroads on Gasquet's second serve, with the Frenchman winning 61 per cent of points behind it.
It was the first time Gasquet overcame an opponent ranked in the top two since beating Roger Federer at the 2005 Monte Carlo Masters.
Next up for Gasquet will be Kamil Majchrzak, who beat Marco Cecchinato 6-2 6-3.
At the last-32 stage, Fabio Fognini went down 6-4 6-3 to Thanasi Kokkinakis and Albert Ramos-Vinolas succumbed to a 7-6 (7-5) 6-4 loss against Christopher O'Connell.
Johan Nikles, Nikoloz Basilashvili and Joao Sousa also advanced to the second round.
Top seed Cameron Norrie cruised into the quarter-finals of the Lyon Open by beating Francisco Cerundolo 6-4 6-4.
The Briton will face another Argentinian next in the form of Sebastian Baez, who came from a set down to beat Oscar Otte 5-7 6-4 6-2.
Alex De Minaur also had to rally for a 1-6 6-3 6-2 win against Ugo Humbert, with Yosuke Watanuki awaiting in the last eight after the world number 263 beat Soonwoo Kwon 6-3 6-4.
The third-seeded Norrie defeated Kyrgios 6-1 6-4 in less than an hour as he tries for a second consecutive title after collecting his first ATP Tour championship at Los Cabos last week.
The former University of Georgia star Isner, a five-time champion in Atlanta, beat Sock 7-6 (8-6) 6-4 despite serving only 13 aces after hitting 36 in his previous match.
Second-seeded Jannik Sinner fell 7-6 (9-7) 6-4 to Australian qualifier Christopher O'Connell, leaving the tournament without its top two seeds after Milos Raonic was upset by Brandon Nakashima on Wednesday.
O'Connell, ranked 132 in the world to Sinner's 23, had not won a main-draw match this year before defeating Denis Kudla in the opening round and will now face Isner in the quarters.
Norrie will meet Emil Ruusuvuori, who advanced when Benoit Paire retired down 3-0 in the third set after the pair had split the first two sets 4-6 6-4.
Ruusuvuori is into his second career ATP quarter-final after making it to the semis at Nur-Sultan last year.