Ralph Sampson took the inbounds pass and scored on a desperation touch shot at the buzzer to give the Houston Rockets a 114-112 victory over the Los Angeles Lakers tonight, eliminating the defending league champions from the NBA playoffs with a four-games-to-one victory in the Western Conference final.

The Rockets tied the score with 15 seconds to play on another improbable shot, a three-point field goal by guard Robert Reid that barely beat the 24-second clock. After Lakers guard Byron Scott missed an 18-foot jump shot with three seconds to play, the Rockets called timeout with one second left to set up the stunning finish.

Houston, down by as many as 17 points in the first half and nine with 8:30 to play, pulled out the victory despite having to play the final 5:14 without their leading scorer and rebounder, Akeem Olajuwon. The center/forward was ejected from the game along with Los Angeles reserve center Mitch Kupchak after an altercation that began beneath one basket and ended four rows up in the stands behind the Los Angeles bench.

Olajuwon still led the Rockets with 30 points, but it was Sampson who held the team together, scoring 10 of Houston's last 13 points to finish with 29.

The Rockets will face the Eastern Conference champion Boston Celtics in the best-of-seven NBA championship series beginning Monday afternoon in Boston.

Center Kareem Abdul-Jabbar led the Lakers with 26 points and guard Magic Johnson had 24. In a spate of optimism that belied their 3-1 deficit, members of the Lakers' public relations department spent much of this afternoon mailing 200 playoff media guides to Boston, where the league championship series will begin Monday.

In the opening moments tonight, the Los Angeles players did their part toward making a trip east a reality, grabbing a 12-6 lead in the first 3:11. Leading the way was Abdul-Jabbar, who scored seven of the Lakers' points, including a free throw for a three-point play following a reverse windmill slam dunk over Sampson.

It wasn't until 7:45 remained in the opening period that Olajuwon touched the ball on offense. Olajuwon, who had averaged 31 points a game in the series' first four games, missed a pair of free throws.

Less than 30 seconds later, Los Angeles had expanded its lead to 18-8. Shortly after a basket by Sampson, the Lakers' James Worthy slammed home a fast break basket to make the score 20-10.

Part of the reason for Olajuwon's lack of offensive involvement may have been the shooting of Lewis Lloyd. The Houston guard scored half of the visitors' first 12 points, all on outside jumpers. Another factor was a defensive switch by the Lakers. Los Angeles opened the game with Abdul-Jabbar on Olajuwon instead of Sampson, who was guarded by Kurt Rambis. Sampson indeed scored a quick six points, but with 3:34 remaining in the quarter, the Lakers still led, 26-15.

An offensive rebound basket by Houston's Jim Petersen at 2:58 cut the margin to 26-17, prompting the Lakers to call a timeout. Before the teams could reach the sidelines, however, a brief scuffle broke out between Lloyd and Los Angeles guard Michael Cooper, who had exchanged heated words moments earlier.

As in Game 4 of the series, Petersen was effective defending Abdul-Jabbar, which helped the Rockets cut what was at one time a 17-point deficit down to five at 28-23. The Lakers regrouped to run off seven points to close the quarter ahead by a dozen, 35-23. Had Cooper released a three-point shot a second earlier, it would have been 10 consecutive points for the Lakers, but referee Earl Strom disallowed the long shot.

Abdul-Jabbar and Worthy each scored nine first-quarter points as Los Angeles shot 64 percent from the field. Sampson had eight points for Houston.

Olajuwon was held scoreless in the quarter, but the second-year man scored four points in the first three minutes of the second period to help Houston move within 39-31.

With 7:36 left before halftime, the Lakers were in front, 43-34. Los Angeles Coach Pat Riley, criticized in some circles for not utilizing his bench enough during the previous four contests, already had used Kupchak, Peter Gudmundsson and Mike McGee in addition to Cooper and Maurice Lucas. McGee, a reserve guard, had not played in eight straight playoff games.

With 5:29 left in the half, Olajuwon hit two free throws to cut the Lakers' lead to 48-42. The significance of the play wasn't necessarily in the points scored but rather that the foul that led to them was the third for Johnson. With the all-star guard out of the lineup seconds later, the Rockets moved within a basket of a tie, 48-46, with 4:37 left.

In the next two minutes, though, Los Angeles expanded its edge to 59-50, the last three points coming on a long-range shot by Cooper. When the Rockets were whistled for a three-second violation on the subsequent possession, Coach Bill Fitch angrily called a timeout.

After the break, Reid hit a jumper for Houston, guard Mitchell Wiggins added two free throws and the score was 59-54 with a minute to play. The half ended with the Lakers on top, 61-54, their last basket coming on an offensive rebound by Abdul-Jabbar.

The Lakers finished the half with a 62 percent mark from the floor.