Andy Murray and Colin Fleming gave Great Britain a 2-1 lead over Croatia going into Sunday's two reverse singles in the Davis Cup World Group play-off.
Murray struggled with a sore back on Friday, but joined his fellow Scot in a 6-3 6-2 6-7 6-1 win against Ivan Dodig and Mate Pavic on the clay of Umag.
Britain were cruising, but Croatia came from behind in set three and won a tiebreak 8-6 before a tame fourth.
GB need one win to return to the World Group for the first time since 2008.
Britain will secure their spot among the world elite if Murray beats world number 35 Dodig in Sunday's first singles match, and the Scot was confident of his chances after facing the Croat in the doubles.
"It definitely helps," said Murray, when asked whether participating in the doubles improved his chances on Sunday.
"You get a feel for the return and I returned his serve fairly well. I got a pretty good read of it, which will hopefully help.
"Colin played exceptionally well, bar a couple of points in the third set, and we dominated the majority of it."
Murray and Fleming broke in the second game of the match and raced to the first set against Dodig and 20-year-old Davis Cup debutant Pavic.
The Britons wrapped up the second quickly with a double break and looked to be closing on victory when they broke Pavic's serve in the first game of the third set.
But the Croatians hit back immediately, stealing Murray's next service game - and they edged to a 5-4 lead as the home crowd became increasingly vocal.
Great Britain were teetering, but two thundering first serves from Wimbledon champion Murray kept Britain in the set at 5-5 before a tiebreak ensued.
Murray and Fleming set up a match point at 6-5 but the inspired Croatians saved it and soon had a set point of their own when Fleming netted.
The white-capped Briton then also dumped two serves into the net to hand the home team a lifeline with the third-set victory.
However, cheered on by a sizeable contingent of British fans, Murray and Fleming raced through the fourth to take their team to the brink of the Davis Cup elite.
"The win today was really important," said captain Leon Smith. "On clay it was definitely the best option. Going into Sunday it now gives us two cracks at it. I'm very confident Andy can come through."
British number two Dan Evans is set to play Coric in the second singles rubber.
In Friday's singles, Murray beat 16-year-old Borna Coric 6-3 6-0 6-3opening day on the Croatian clay, before Evans, ranked 149, lost 6-3 6-2 6-3 to Dodig.