Vitas Gerulaitis upset his Long Island neighbor, John McEnroe, 3-6, 7-6, 7-6, in a spotty but ultimately tingling 2 1/2-hour match tonight at Madison Square Garden, reversing the result of last September's U.S. Open final in the last round-robin session of the $400,000 Colgate Grand Prix Masters Tourament.

Consequently and ironically, the showdown for the No. 1 world ranking in tennis for 1979 between McEnroe and Bjorn Borg -- who routed Jose Higueras tonight, 6-2, 6-0 -- will take place in the semifinals Saturday, and not in Sunday's final.

In the first of the nationally televised semis (WDVM-TV-9, 4:30 p.m.), Gerulaitis will play Jimmy Connors, who today fought back from 1-4 down in the final set against Roscoe Tanner and capitalized on the collapse of Tanner's serve-and-volley game to win, 2-6, 6-4, 7-6.

Earlier in the afternoon, Harold Solomon surprised a stiff-legged and erring Guillermo Vilas, beating the Argentinian left-hander for the first time since 1976, 6-2, 6-2. Solomon thus knocked Vilas out of contention for the semifinals even though Solomon already had been eliminated himself.

The format for the Masters, the last shootout among the top eight point-winners in the season-long world-wide Colgate Grand Prix circuit, calls for three days of round-robin play among four-man groups. Then the two men with the best records advance to the "knockout" semi-finals, with the No. 1 finisher of one group playing the No. 2 man of the other.

Gerulaitus' thrilling and popular victory over McEnroe tonight, after saving a match point in the second set tie breaker, left both with 2-1 records. s

But Gerulaitis collects the $10,000 bonus money for finishing first in his group by virtue of his head-to-head triumph over McEnore. Solomon and Vilas both finished 1-2, but Solomon earned third-place money of $20,000 compared to Vilas' $13,000 by the same tie-breaking procedures.

Borg finished 3-0 in the other group; Connors, 2-1; Tanner, 1-2; and Higueras, 0-3.

The winner of Saturday's Borg-McEnroe match will go on to play the Gerulaitis-Connor winner for a $100,000 first prize Sunday, and will be generally recognized as the No. 1 player for 1979.

Borg has compiled a singles record of 84-6, winning 12 tournaments, including the French Open and Wimbledon. McEnroe is 91-13 for the year in singles and won 10 tournaments, including the World Championship Tennis playoffs and the U.S. Open.

Borg had a 4-2 record head to head with McEnroe in 1979, but McEnroe won their only meeting in a major tournament, the WCT Finals in Dallas. Another victory in the Masters, which officially ends the 1979 season 13 days into the new year, could tip the scales in favor of McEnroe, especially if he should go on to win his Third "major" of the year Sunday.

McEnroe also has won 16 tournaments in doubles. Saturday night he and Peter Fleming, the Wimbledon and U.S. Open champions, will play Tom Okker and Wojtok Fibak for the $40,000 doubles first prize.

Okker and Fibak tonight beat Marty Riessen and Sherwood Stewart, 6-2, 7-6. McEnroe and Fleming, the top team in the world, beat Australians Mark Edmondson and John Marks, 7-6, 6-7, 6-3, in a match that began late Thursday night and ended at 1:30 Friday morning.

The Gerulaitis-McEnroe match was expected to be a bit anticlimatic, since both players already were assured semifinal berths.

Gerulaitis -- who was born in Brooklyn grew up in Queens, and now lives in King's Point, 10 minutes from McEnroe's lifelong residence in Douglaston -- did not win a set in three 1979 meetings, including the Open final played 10 minutes from their front doors in Flushing Meadow.

McEnroe had been much sharper, the complete master of touch and spin at the net, in beating Solomon and Vilas, than Gerulaitis had been in losing to Vilas and beating Solomon. Therefore, it was anticipated that McEnroe would win routinely again and play Connors in the semis, leaving Gerulaitis to face Borg, against whom he has a 0-14 career record.

But as Gerulaitis pointed out later, this was not a routine match but another "battle for New York" with 14,820 spectators at the Garden screaming and exulting over some absolutely spectacular points in the closing minutes, this became a memorable encounter.

Gerulaitis won the second set tiebreakers, 9 points to 7, after saving a match point at 5-6 with a service winner to McEnroe's left-handed forehand.

The third set went on serve until the ninth game, when Gerulaitis hit a forehand down-the-line return after two deuces to get the break point for the second time. McEnroe told umpire Frank Hammond that he had ticked the ball in a vain effort at a stab volley -- an honest call against himself by the legendary "Super Brat" who had infuriated much of the crowd earlier by his incessant and surly questioning of line calls.

Gerulaitis got the break a moment later when his backhand service return clipped the net cord and dribbled over for a winner. But he was broken from 30-15 as he served for the match, McEnroe's forcing errors with two-great service returns and then tapping an easy volley into an open court after jerking Gerulaitis short with a marvelous drop shot from the fore-court.

The final set produced some all-time points amidst a clutter of errors. These two players are extraordinary in their speed, anticipation, athleticism, touch and reflexes at the net, and they darted around the court, quick as hummingbirds, teasing each other with shots and angles invented for the moment.

Most of the time McEnroe will win at that game because, as Gerulaitis readily admits, "Mac is a more talented player than I am, with more flair. Nobody has as much touch as he does."

But this was Gerulaitis' night, as he demonstrated on a remarkable point that got him to advantage on his serve at 5-6, after McEnroe had held at 15.

Gerulaitis served and got to the net for two crisp volleys, the second an apparent winner. McEnroe lunged for the ball deep in his backhand corner and somehow floated it back deep. Gerulaitis dropped to his knees in hitting an overhead from the baseline, then sprawled on the court. McEnroe chased down the ball and blocked it back over.

Gerulaitis scrambled to his feet and made an astonishing forehand "get" to stay in the point, then followed his body's momentum into the net for a winning forehand drop volley down-the-line.