Playing his first tournament since winning his fourth grand slam title at Wimbledon, world No.1 Sinner was made to battle in the second set as world No.35 Diallo held a set point at 6-5 in the tie-breaker.
The start of Sinner's evening third-round match was delayed by an earlier 75-minute delay when the venue lost power and play was halted in the second game of the second set when a fire alarm in the 1899 club grandstand began to sound.
But Sinner was able to extend his winning streak on hard courts to 22 matches as he advanced to a match up against French qualifier Adrian Mannarino, who overcame 13th seed Tommy Paul 5-7 6-3 6-4.
"I feel like today was a very difficult day at the office," said reigning Australian Open champion Sinner.
"He was serving very well, especially in the second set. Against big servers you always have to find the right balance at the back of the court.
"Today I struggled a bit at times. But still very happy. I need these tough matches ... Getting used to very difficult situations. I'm very happy this happened before a grand slam.
"I'm happy about today. Can I do things better? Yes. But not every day is the same. So I'm very, very happy."
Sinner has not been beaten on hard courts since a defeat by Carlos Alcaraz in the the Beijing final in October.
Earlier, fourth seed Taylor Fritz defeated Italian Lorenzo Sonego 7-6 (7-4) 7-5 after the power outage delay.
The 27-year-old American did not face a break point and capitalised on his lone break opportunity before serving out the match.
In other matches, Benjamin Bonzi beat Stefanos Tsitsipas 6-7 (7-4) 6-3 6-4, 10th seed, Frances Tiafoe downed Ugo Humbert 6-4 6-4, seventh seed Holger Rune beat 28th seed Alex Michelsen 7-6 (7-4) 6-3 while Felix Auger-Aliassime and Terence Atmane also notches wins.