Patel, who took nine wickets in New Zealand's 1-1 draw in their Test series in Sri Lanka last month, has spent most of the English summer playing club cricket as Cranleigh's overseas professional.
Yorkshire can mathematically still win the Championship - though would be reliant on Essex and Somerset suffering a severe downturn in form if they were to win the title.
"I came over to play at Cranleigh CC this winter, hopefully with the opportunity to pick up some county cricket while I was over here," Patel said. "But I obviously got called into the New Zealand squad for the Sri Lanka Tests while I was over there. It all happened pretty quickly from there, I got the call and jumped at the opportunity really.
"It's exciting and Yorkshire are in with a chance of winning another County Championship. It's a club with a lot of history and one that's been pretty successful in the championship in the past. I'm coming for two games and hope to contribute as much as I can and to try to do as much as I can to help Yorkshire into the best position to be able to win the competition as they approach the end of the season.
"I've had a good tour of Sri Lanka, where I was quite successful in their conditions. Confidence-wise I'm feeling good and the ball is coming out really nicely."
Yorkshire have been without Adil Rashid for the entirety of their Championship season due to international duty and injuries, while Josh Poysden has missed the second half of the campaign due to a freak head injury after being struck during a nets session.
As a result, they have had to recruit from elsewhere to find a spinner. Dom Bess played four games on loan from Somerset, while Maharaj is the same number of games into his stint as an overseas player.
Martyn Moxon, Yorkshire's director of cricket, said: "Ajaz has had a good last two or three seasons in domestic cricket and he's currently in the New Zealand Test squad. We feel he's well qualified to come in and be available for the last two games for us, when hopefully we can continue our push to finish as high as possible in the County Championship.
"We want to finish as high in the County Championship as possible; mathematically it's possible that we can still win it and we want to give ourselves the best possible opportunity. We looked at the options to fill Kesh's shoes and we think Ajaz is the best to do that.
"We've spoken to those that know him well and he has been one of the most consistent performers in domestic cricket and he has done well in Sri Lanka for New Zealand recently."