In a 3-hour, 36-minute epic that built to a climax worthy of great drama, Jimmy Connors came back from a 3-5 deficit in the final set yesterday to overcome an inspired Adriano Panatta, 4-6, 6-4, 6-1, 1-6, 7-5, in the fourth round of the suddenly sizzling U.S. Open Tennis Championships.

Panatta, 28, the richly gifted Italian who has been training hard to regain the form that won him the Italian and French opens in 1976, served for the match at 5-4 in the fifth set and was within two points of victory at 30-all.

But Connors, digging deep and finding the lion-hearted competitiveness that made him the dominant player in the world in 1974, ripped two blazing returns - a backhand down the line off a second serve and a forehand down the line off a good, deep, wide first serve.

Connors - cleanching his fists, slapping his thighs, strutting after every winner and driving himself into a frenzy - raised the level of his shot-making and scrambling to the sublime in winning the last four games.

Panatta saved four match points as he served at 5-6 in the tingling final set, but Connors got to match point for the fifth time on an astounding shot - a running backhand down the line off a ball 10 feet out of court and practically behind him. Panatta's forehand cross-count volley would have been a sure winner against virtually any other player.

Connors played the not onehanded, unable to get his right hand on the racket for his usual two-fisted grip on the backhand, and drilled the ball around the net post. It landed inches inside the sideline as Panatta watched forlornly.

"When I took off after that ball, I knew I could get to it, but I didn't know what I'd be able to do with it," Connors said. "First, I just wanted to get it back, to make him play another shot. But he wasn't in great position, so I went for it. It nearly took the net judge's head off."

That memorable point came on the heels of controversy.

Moments before, Panatta had served and charged the net for a back-handed volley that probably would have given him his second advantage point. But just as he punched the ball, chair umpire Herb Lewis of Coral Gables, Fla., called, "Fault," overruling service-line umpire Adrian Clark, who said Panatta serve was on the line.

Clark got out of his chair and objected, but the chair umpire was firm in his decision, exercising, for the fourth time in the match, his power to overrule line calls.

Panatta's second serve was a good one, but after a scrambling point, Connors hit that wonderful desperation backhand.

Panatta, who had lived by the serve, then died by it. He went for an ace down the center on the fifth match point, and missed it. He took a deep breath and gambled on a deep second serve, and it was an inch long. Double fault.

Panatta, the handsome 6-foot-2 Roman who went into eclipse after winning the two premier clay-court titles of Europe two years ago, is currently ranked only No. 33 in the world. But he is a player of exceptional talent, combining a powerful serve and volleys with speed and torch.

He is classical shotmaker, and a though man with match points against him - as he demonstrated by saving 11 of them in the first round of the Italian and one in the first round of the French the year he won.

He challenged Connors to the limit, and the 26-year-old left-hander from Belleville, Ill. - champion of the U.S. Open in 1974 and 1976, runner-up in 1975 and 1977 - responded.

"In Italy, we have a saying: "He did not want to die." I think that is the biggest positive point for Jimmy," Panatta said. "He fights on every point, so you can't relax not even one single point."

Connors knew he had been tested down to the last ounce of his fighting spirit. His old, familiar intensity the self-exhortations were back, and he brought them to bear.

"This was as good a match as I can play," he said, agreeing to meet the press for the first time during the tournament, but only under his ground rules: "Five minutes, and only questions about the match."

This was the second breathtaking match within 24 hours to grace the first open at the new National Tennis Center in Flushing Meadow Park. Monday night, Californian Butch Walts ousted defending champion Guillermo Vilas, 6-4, 7-6, 4-6, 6-7, 6-2, in a 4-hour 11-minute classic that was of a consistently higher standard, but no nearly as gripping in the final set.

Connors' victory put him into the quarterfinals against Brian Gottfried, who returned serve superbly and played smartly aggressive tennis to beat Roscoe Tanner, 6-2, 6-4, 6-1. Gottfried is the only player to reach the quarters without losing a set.

No. 1 seed Bjorn Borg, seeking his first U.S. title and the third leg of the French Wimbledon-U.S.-Australian Grand Slam crushed Harold Solomon for the 11th time in as many meetings. This time the scrores were 6-2, 6-2, 6-0.

"I don't go into matches against him with a defeatist attitude . . . I don't feel there is no way I can beat him until we get out there and start hitting," said the thoroughly beaten Solomon. "I don't feel there's anything I can do to hurt him."

The other quarterfinal pairings are Walts vs. John McEnroe, Vitas Gerulaitis vs. Johan Kriek and Borg vs. the winner of last night's match between Raul Ramirez and Arthur Ashe.

The Panatta-Connors match was patchy in quality, but the 65-minute final set was gripping. It had everything-spectacular shot-making lunging "gets," the controversial overruling of a call and Connors' heroic last stand that riveted 14,531 screaming spectators to their seats in Louis Armstrong Stadium.

Panatta, who grew up on clay courts but has an oppressive serve and net game that paid dividends on the rubberized asphalt surface here, served well for the first set. But he lapsed at the end of the second and throughout the third.

The crowd, cheering Panatta wildly more for the sake of seeing a good match than as an expression of dislike for Connors, a frequent villain, spurred on the Italian. The late-afternoon sun was pouring down on him, the crowd was alive and whooping, and he must have felt a bit as if he were home again at Foro Italico in Rome.

Panatta has seldom played well in the United States - in four appearances at Forest Hills, this tournament's home the last 54 years, he never got beyond the third round - but he showed his flair yesterday. He served 15 aces and bore in behind all his first and many of his second serves, blanketing the net for agile, penetrating volleys and the spinning, backhand overheads that he angles away like no other modern player.