The seven-time series champion had trailed team-mate Jorge Lorenzo since returning to Yamaha from Ducati over the winter.
But when the field finally had some dry running at Jerez on Sunday, Rossi emerged fastest, beating Lorenzo by 0.015 seconds.
The Italian said the result was a significant turning point.
"I'm so happy, especially because we used a different style of setting," said Rossi.
"It is very important for us to understand this setting, which can help and affect my riding style to ride the bike in a better way and stay more constant, especially with good lap times on old tyres.
"To make the first position with a time of 1m39.5s is good and also being as fast as Jorge.
"Me and my team are very happy with the pace."
Rossi led a Yamaha one-two-three, backed up by Lorenzo and Tech 3's Cal Crutchlow.
Lorenzo felt the performance was just what Yamaha needed after Honda had dominated their private test at Austin earlier this month.
"We worked on suspension and electronics today and we saw that compared to Austin the Yamahas were much more competitive," he said.
"There are three Yamahas in the top three and that is good for the motivation of the brand."
- Sports & Recreation
- Jorge Lorenzo