Raonic, the 11th seed from Thornhill, Ont., was tested for nearly two and a half hours in the demanding heat that hovered just above 40 C.
The heat was even too much for one of the ball kids, who had to leave the court in the middle of the match.
Raonic finally put away the victory on his fifth match point against an opponent ranked 77th in a first-time meeting.
"The heat was not a problem, but I struggled with a gusting wind, it was moving all around," said Raonic. "I also struggled to get back after losing my serve twice in the first set. I was very disappointed with that.
"But I feel I'm doing a lot of stuff better on returns, I can give myself opportunities this way."
Canadian qualifier Frank Dancevic felt the heat as he was treated on court trailing 4-2 in the second set before eventually going down to France's Benoit Paire 7-6 (14-12), 6-3, 6-4.
Dancevic said he started feeling faint and was stretched out on court with a doctor, trainers and ambulance personnel in attendance.
But the Niagara Falls, Ont., native recovered and soldiered on, wisely donning a white cap and finishing the match.
"I went to black for a while," said Dancevic. "But it may have seemed longer to me than it was. It was really hot, I don't think we should be playing tennis in this kind of heat."
Raonic took the victory with 21 aces, striking 48 winners and breaking on 7-of-20 chances. The 23-year-old was frustrated as he tried to close out the contest but finally got the job done when he broke the Spaniard's serve.
He'll join compatriots Eugenie Bouchard, from Montreal, and Vancouver's Vasek Pospisil, who won their first-round matches on Monday.
"The Canadians are putting themselves into good position: Frank (Dancevic) did good going through qualies, Vesek is playing well from the start of the season and Genie has been playing well also," said Raonic.
Raonic will next take on Romanian Victor Hanescu, who defeated Poland's Peter Gojowczyk 7-6 (5), 7-6 (5), 6-3. Raonic has a 1-1 record in the series, losing their first match in a Toronto first round.
"My coach (Ivan Ljubicic, who stands 5-1 in that series) has played him a few times," said Raonic. "I know Victor's game, I know what to expect.
"There won't be any big changes."
Raonic and Gimeno-Traver struggled to adjust to the conditions in the 46-minute opening set.
Raonic emerged 4-4 after three consecutive breaks of serve before finally getting an edge on Gimeno-Traver. As the set wound into the tiebreaker Raonic took command, leading 5-1 on his way to setting up four set points and converting the first with an ace.
Raonic, who reached the fourth round in Melbourne in 2011 and 2013, swept the second set 6-1, but was caught out in the third as Gimeno-Traver got on the scoreboard.
But Raonic re-asserted himself in the fourth, earning a 5-2 lead and reaching his first three set points.
Forehand errors spoiled the quick winning scenario, with Raonic forced to finally go through on his fifth try as Gimeno-Traver sent a backhand return wide down the line.