Portuguese forward Carvalho who celebrated his 20th birthday on Tuesday and came off the bench to complete Liverpool's comeback from a goal down after they looked to be heading for a point.
Having had a stuttering start to the season, Liverpool looked set for another frustrating night when Luis Diaz squandered a great chance, latching on to a superb pass by Roberto Firmino and taking the ball around keeper Nick Pope before spooning it over the bar from a difficult angle.
The Reds then went behind when Newcastle's record signing Alexander Isak latched on to a pass from Sean Longstaff and rifled it home in the 38th minute to score his debut goal.
The 22-year-old looked to have doubled his tally early in the second half with a superb run and shot, but his effort was disallowed for offside.
That seemed to be the wake-up call Liverpool needed and they struck back in the 61st minute through Firmino, who coolly drove home Mohamed Salah's cut-back to the relief of the home fans, some of whom had booed their side at halftime.
Isak's debut came to an end three minutes after the equaliser when he was replaced by Chris Wood, and the visitors struggled to get the ball up to him as Liverpool pressed forward relentlessly, peppering their goal with shots.
Newcastle defended stoically but Carvalho made the most of their failure to clear a corner, thumping his shot into the roof of the net to snatch a win that lifts Liverpool to fifth in the table on eight points, with Newcastle 11th on six points.
"We've shown up today for the fans, they've helped us so much, I want to say a big thank-you to them because without them this wouldn't be possible," an elated Carvalho told reporters.
After seeing his side concede one of the latest winners in Premier League history, Newcastle manager Eddie Howe described the result as "painful".
"I don't really remember them having too many clear-cut chances. Yes, they had pressure, they're long shots, but I thought we defended really well. The last goal is really a heartbreaker for us," he said.