Dallaglio's men, targeting a fourth successive league title, looked down and out when play-off rivals Gloucester led 32-20 midway through the second period at Kingsholm.
But late tries by wing Paul Sackey and England flanker Joe Worsley, his second touchdown of the match, broke Gloucester hearts after England Under-21 stars Ryan Lamb and Anthony Allen threatened to sting Wasps beyond recognition.
Fly-half tormentor Lamb contributed 17 points and Allen scored two tries, but the 19-year-olds were ultimately undone by a Wasps side who kept their composure when it really mattered to secure a 37-32 triumph, helped by full-back Mark van Gisbergen's 22-point haul.
Wasps now face Sale Sharks at Edgeley Park on Sunday week, with the winners tackling Leicester or London Irish in a Twickenham title shoot-out on May 27.
"It was a fantastic game of rugby," said Wasps skipper Dallaglio.
"We played very well at times, and we made mistakes at others, but you are not champions for three years running without having a fighting spirit.
"We showed a lot of heart and courage, and we are now in there with a shout. Winning here will give us real confidence going into our toughest challenge of the season so far."
Wasps rugby director Ian McGeechan added: "It was such a challenging game for both teams. A few people had questioned the desire at the club, but we showed again how much it matters.
"It will be a big challenge for us now against Sale. They have kept their noses in front this season through their consistency, especially at home.
"For us, these games are a series of cup finals, and we are doing it away from the Causeway Stadium. I think there will be a fair bit of rugby played next week."
Gloucester's heart-breaking defeat left them in fifth place, but head coach Dean Ryan is upbeat about the west country club's prospects for next season, especially with players like Lamb and Allen on board, and they also have a European Challenge Cup final to contest in a fortnight's time against Irish.
"We have got a very clear picture of where we are going, and I am quite excited about the future," he said.
"We wanted to win and make the semi-finals, but we didn't play very smartly during the final 10 minutes. We weren't smart enough to finish things off.
"The pain of this defeat will be an important component for the future. We've got a lot of talented young players, and they will be great players if they listen and learn."
Gloucester centre Mike Tindall and scrum-half Peter Richards, meanwhile, both suffered injuries just three weeks before England head to Australia for their two-Test summer tour, although there was no immediate fitness bulletin on Tindall (back) or Richards (knee) after they went off at half-time.