The front pair were a handful for the Liverpool defence throughout the 2-2 draw at Elland Road.
Eirik Bakke and Viduka both scored in a five-minute spell in the first half between goals from former Leeds favourite Harry Kewell and Czech, Milan Baros.
Gray said: "I have said in the past it is important we keep the front two fit. That gives a lift to the boys and a lot of inspiration when they see Mark Viduka and Alan Smith up there.
"They then know that when those two are playing we have a chance and that is important to us."
Smith and Bakke were left nursing injuries that should clear up in time for the match against Fulham a week on Saturday.
Gray revealed that Smith did well to play in the game, as he had not trained all week after suffering severe leg bruising against Manchester United.
Smith received a knock on the same leg late in the game and was substituted, and Bakke suffered a recurrence of the thigh trouble that had been bothering him for several weeks.
With no fixture next weekend because of the FA Cup, both players have more time to recover for the game at Loftus Road.
Gray said: "I have always believed we have the capability of picking up points and pulling clear of relegation and the players believe that too. I thought they performed well against a good Liverpool side."
Gray says Leeds must continue getting results at Elland Road if they are to have any chance of avoiding relegation.
Yesterday's draw meant Leeds stay bottom but with all their rivals also drawing at the weekend, they have not lost ground.
And Gray believes the drop is still avoidable providing Leeds get results in all their remaining games at Elland Road, against Manchester City, Leicester, Everton, Portsmouth and Charlton.