The British number one - who received a bye in the first round - battled back from a set and a break down to take it to a decider.
Momentum seemed to have shifted after his opponent appeared to be struggling with an abdominal injury.
However, Ramos-Vinola rallied back and earned a 6-4 2-6 6-4 victory to earn his eighth victory over a player ranked inside the world's top 10.
Ramos-Vinolas - who won in two hours and 32 minutes - has a perfect record against Norrie on clay, winning all four of their meetings on the surface. The only win Norrie has over the Spaniard is on grass at Queen's in 2021.
Norrie was up against it from the very first game and was forced to save a break point with two aces. In the seventh game, Norrie was broken though and lost the set.
Ramos-Vinolas broke Norrie once again, this time in the opening game of the second set and he took a 2-0 lead. However, Norrie showed his worth, winning six games in a row to push for a deciding set.
After taking a painkiller for his injury, Ramos-Vinolas rediscovered his best form in the final set and one break of serve was enough to secure a rollercoaster win.
"We always have good matches and he's in the top 10 so for me today it's a great win," Ramos-Vinolas said in an on-court interview.
"I started off well and was 2-0 up in the second set but tennis is like this. I lost seven (games) in a row but somehow I start to play good and I'm happy to be in the next round."