Despite the win on Friday night, newly promoted Rayo are 18th, with 19 points from 19 matches. Celta, at 21 points, hold the 14th spot mid-way through the campaign.
The contest began at a frenetic pace and some of the 11,465 spectators were still finding their seats at Madrid's Vallecas stadium when De Tomas opened the scoring in the 4th minute, beating visiting goalkeeper Ruben Blanco on a direct free kick, reports Efe news.
Instead of encouraging Rayo, getting the early lead appeared to leave the hosts disoriented.
In the 13th minute, a poorly defended corner led to Nestor Araujo's equalizer for Celta, who took the lead five minutes later when Maxi Gomez converted from the penalty spot after Rayo's Abdoulaye Ba was called for a hand ball.
Celta grew complacent and Rayo regrouped.
Minutes after seeing an apparent goal disallowed based on the judgment of the Video Assistant Referee, De Tomas got his second of the night in the 37th minute, this time with help from VAR.
Rayo picked up where they left off in the second half, yet Celta worked their way back into the contest and Gomez nearly gave his team a 3-2 lead on a free kick that hit the crossbar.
With nervousness taking hold among the supporters, De Tomas completed his hat trick in the 77th minute to put Rayo ahead to stay.
Bebe added a goal for Rayo in stoppage time to make the final 4-2.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)