Danny Green scored 24 points and broke Ray Allen's finals record for 3s in a series with 25. Tony Parker had 26 points for San Antonio.
LeBron James scored 25 points on 8-for-22 shooting for the Heat and Dwyane Wade had 25 points and 10 assists. But the Heat missed 21 of their first 29 shots to fall behind by 17 points in the second quarter of another uninspired performance.
Game 6 of the best-of-seven series is Tuesday night in Miami.
Whirling through the defense like the Manu of old, Ginobili shrugged off a postseason full of disappointment to deliver a performance that the Spurs have never needed more desperately. He hit 8 of 14 shots and had his highest points total since June 4, 2012.
Tim Duncan had 13 points and 11 rebounds, Green was 6 for 10 from 3-point range, and Parker gutted through 36 minutes on that tender right hamstring. Kawhi Leonard had 16 points and eight rebounds, and the San Antonio shot 60 percent to overcome 19 turnovers.
Allen scored 21 points and Chris Bosh had 16 points and six rebounds for the Heat, who were stunned by a vintage Ginobili performance early and never really recovered.
Miami missed 21 of its first 29 shots and Green hit three straight 3s in the middle of the second quarter to tie Allen's record of 22. The Spurs led 47-30 on Duncan's two free throws before the Heat finally showed some fight.
A 12-0 run got them back within striking distance at 47-42 and the Heat surged out of the halftime gates to cut San Antonio's lead to 61-59 in the first 1:17 of the third.
San Antonio pushed right back, getting a jumper from Parker, a 3-pointer from Green that broke Allen's record and a lefty layup from Ginobili to get a little breathing room.
Ginobili closed the third with a twisting, off-balance, left-handed runner and a right-handed drive to the bucket to bring cheers of ''Manu! Manu!'' from the delirious crowd.
Nowhere to be found in the first four games, and for most of these playoffs, Ginobili had his fingerprints all over the opening of Game 5. He hit a step-back jumper, had two pretty assists on a backdoor cut from Green and a thunderous dunk from Duncan and knocked down two free throws for an early 9-4 lead.
Ginobili's 3-pointer from the wing made it 15-10, bringing the nervous crowd to its feet. The awakening was a welcome sign for the Spurs, who desperately missed their playmaking daredevil.
The Heat reclaimed momentum in Game 4 thanks to a shuffle of the starting lineup by coach Erik Spoelstra, who moved sharp-shooter Mike Miller into the starting lineup in Udonis Haslem's place, giving Miami a smaller lineup that spaced the floor better and gave James and Wade room to operate.
Spurs coach Gregg Popovich made a move to match that on Sunday night, putting the struggling Ginobili in for center Tiago Splitter. Ginobili was averaging 7.5 points in the first four games and shooting 34 percent. In the final year of his deal, the soon-to-be 36-year-old was asked about retirement on Saturday.
The crowd roared for Ginobili when he was introduced last, with one banner reading ''We still Gino-believe!''
Wade had endured a similarly quiet start to these finals before erupting for 32 points and six steals in Miami's Game 4 victory that evened the series. That carried over to the opening quarter of Game 5, when Wade's assertive play helped Miami withstand Ginobili's initial haymaker.
Wade's trademark euro-step on the break and two free throws kept the game tight and James hit a 3-pointer to tie it at 17 with under 5 minutes to play in the period.
The two teams entered Game 5 riding a pendulum of momentum that was swinging wildly back and forth over the previous three games. A classic, air-tight Game 1 victory by the Spurs gave way to three blowouts - Miami by 19 in Game 1, San Antonio by 36 in Game 3 and the Heat by 16 in Game 4.
The volatility made it difficult for either team to feel like it had a grip on expectations heading into the pivotal Game 5, but the Heat did appear to finally assert themselves with a dominant performance from their three All-Stars on Thursday night.
James, Wade and Bosh broke out of a series-long malaise to combine for 85 points, 30 rebounds and 10 steals, finally finding a way to get to the rim against the paint-clogging Spurs defense.
But for a team as talented and experienced as they are, these Heat have shown a maddening inconsistency over the last month. The team that won 27 straight during the regular season came into the game having going 11 straight games without winning two in a row.
There was so much more riding on this game for the Spurs than the Heat, who reclaimed homecourt advantage with their decisive victory in Game 4. Under the current 2-3-2 format that was adopted in 1985, no visiting team has won both Games 6 and 7 on the road in the finals.
And the Spurs played with more urgency from the start.
Now the Heat's backs are against the wall one more time. And it was Ginobili who put them there.