Sinner needed five sets to defeat the Serbian in a match which saw him take a tumble and suffer bleeding from his foot.
The underdog made the brighter start, breaking once to claim the opening set as Sinner struggled to find his rhythm. The top seed responded emphatically in the second, raising his intensity from the baseline and levelling the contest with a single break.
The third set proved pivotal. Sinner recovered from a worrying fall and saved break points before the set went to a tie-break, where Kecmanovic edged ahead to move within one set of a major upset.
Facing elimination, the Italian produced his best tennis of the afternoon. He broke early in the fourth set and never looked back, striking cleanly and forcing errors from his tiring opponent to send the match into a decider.
Sinner then seized control of the fifth, earning the crucial break midway through the set before serving out the match with authority. He sealed victory with a powerful fist pump after completing his comeback and extending his winning run at Wimbledon to eight matches.
Sinner will play Nuno Borges in the next round and he remains the overwhelming favourite to win the grass court Grand Slam again this season.
After his match, Sinner was asked by the BBC about his fall and bloody trainer.
Asked if his injury was anything to worry about, Sinner responded: "No, no I'm good. It just seems much worse than it is. I'm actually very surprised they let me keep playing because all white turned into a little red.
"It's just a nail that I didn't want to disturb. I think Miomir we both had a great rhythm, I didn't want to take any time. It's all good, thank you!"
Sinner also took time to credit the Centre Court fans at Wimbledon, as he played the first match on the iconic court on the first day of play.
"Thanks for coming. Such a huge honour to start the tournament for the first player," he said during his on-court interview. "I was a little tight in the beginning. I didn't play my very best, but I tried to get into it.
"It was my first official match on grass, which is very important. I'm happy that I turned it around. The third set was a very tough one to swallow, but I'm very happy. Big honour to play in front of you so thanks for coming."
This is the first time Sinner has opened up Centre Court at Wimbledon and he admitted that he was nervous ahead of his clash with Kecmanovic.
"It was a very different feeling. There's a lot of nerves when you go down the stairs behind the court. Also mentally knowing it's such a prestige and historic court," he said.
"Coming back here as defending champion means a lot to me, even though every year is very tough. Very happy to win the first one, of course we will aim for a couple of improvements for the next match but today I can be very happy.
"I felt the first couple of sets there was a lot of mistakes on the forehand side. It's normal, first round matches are never easy. I try to accept that, try to raise my level when I definitely needed to.
"Third set was very tough. Very great points from his side, but this is tennis. Every day is different."
This is the second time in a row the defending champion has needed five sets to win their match, following Carlos Alcaraz's scare against Fabio Fognini last year.