The Iranians looked to have sealed a final date with Nagoya Oceans after they led 5-4 inside the final minute of normal time but Hassan Zadeh's late penalty drew the hosts level.
However, Keshavarz's strike in the first additional period was enough to finally end Al Rayyan's brave challenge.
Shahid took the lead with just under eight minutes to go in the first-half when Ali Rahnama dispatched a lay-off into the top corner and the Iranians doubled their lead after Morteza Azimaeidivkolaie re-directed a long-range effort past keeper Badi Johar.
Al Rayyan halved the deficit when Mauricinho expertly brought down a long ball and fed the onrushing Ahmad Al Faydah, who tapped home from almost on the line.
However, Rahnama netted his second and Shahid's third goal to give the Iranians a two-goal cushion at the break.
They extended that lead early in the second-half when Masoud Daneshvar's cross evaded Johar's outstretched hand and Ahmad Esmaeilpour applied the finish.
Mohammad Tahiri grabbed Al Rayyan's second with a well-taken goal before Saad Al Shahwani further reduced the arrears when he fired a low shot past keeper Mojtaba Nasirniaiefarouji.
The hosts then squared the contest with just over five minutes to go when Zadeh spun and dragged a shot into the far corner of the net.
However, just over a minute later, Shahid were back in front when Azimaeidivkolaie poked home from close range.
The lead did not last, though, as Al Rayyan were awarded a penalty with 23 seconds left and Zadeh held his nerve to send the game to extra time.
But Shahid again edged in front when Mohammad Keshavarz slotted in and it proved enough for the Iranians to set-up a final meeting with Nagoya Oceans.