A tight first half saw Paddy Jackson kick the Irish province into a slender lead before Craig Gilroy’s try extended the advantage early in the second half.
However, back roared Cardiff Blues with man-of-the-match Rey Lee-Lo the architect of a superb score from Patchell.
And two minutes from time more slick handling released Summerhill to dot down in the corner and spark wild celebrations from the home side as they re-ignited top six aspirations.
Cardiff Blues went into the game on the back of two narrow losses and coach Danny Wilson made six changes in total to the side, with notable first PRO12 starts for Tomos Williams and Brad Thyer.
The home side looked strong in the early set piece collisions before back row Josh Turnbull characteristically won a penalty after superb work at the breakdown following a strong carry from Nick Williams.
Another big scrum won a home penalty but Patchell saw his first kick of the match sail wide left of the target.
Hooker Matthew Rees sparked an attack from deep when he hacked the ball up field, after fly half Paddy Jackson spilled in a congested midfield, but wing James just failed to beat full back Stuart Olding to the loose possession.
Jackson pushed a penalty attempt of his own across the posts on 19 minutes as the game remained scoreless.
Slick handling from the backs freed Jarrad Hoeata and in turn Summerhill, then on the opposite flank it was the impressive all-action Lee-Lo who popped a sublime pass out first time to Turnbull but he was hauled down.
It was Jackson, though, who eventually opened the scoring against the run of play with a penalty from in front of the posts on 32 minutes, after neat phase play from Ulster secured the opportunity.
Visiting scrum half Ruan Pienaar was looking to boss territory with some clever low kicks in behind forcing Cardiff Blues to play from deep. And it duly worked as a penalty, for not releasing, allowed Jackson to double the lead four minutes before the interval.
However, Patchell did hit back with a stunning long range effort on the stroke of half-time as the Irish province led 6-3 at the break.
The home side made a half-time change, as Taufa’ao Filise replaced Salesi Ma’afu up front, and the big prop was immediately in the thick of the action with a carry and offload.
Patchell then slotted a long range monster penalty to level the scores and the home side appeared to have the wind in their sails as Blaine Scully and Tom James both rattled up the flanks before Fish injected some pace down the middle.
But a break from Franco van der Merwe wrestled back the advantage before a tap and go from Pienaar, when Ulster could have gone for the points, paid dividends. Centre Sam Arnold used all his power to break the game line and drew the full back before feeding the supporting Gilroy to race over for a 13-6 lead.
A big home scrum looked to fire a response before Lee-Lo’s quick feet found a gap but he slipped and the chance was lost.
The home attacks continued to come strong as a quickly taken lineout from Fish saw Patchell hit the line and blast through a gap. He fed ball back to Fish, but he was hauled down by Olding’s try saving tackle.
Nick Williams was guilty of a blind pass off the back of a scrum that only found Tomos Williams, but the pass wide failed to find James. The Wales wing, though, did get his hands on possession soon after as he tore up the middle to find Patchell.
Patchell cut into the lead on 66 minutes with his third penalty of the afternoon before Jackson inexplicably missed a simple kick from in front two minutes later.
A hectic final ten minutes exploded into life on 74 minutes as the always powerful running Lee-Lo broke a tackle and neat handling from Turnbull sent Patchell over to a thundering ovation. His conversion made it 16-13.
More impressive attacking play saw replacement Jarrod Evans break clear and feed Lewis Jones.
But the best was saved until two minutes from time when quick hands down the line released Summerhill who had the simple task of touching down in the left hand corner.
32m Jackson p 0-3
37m Jackson p 0-6
40m Patchell p 3-6
43m Patchell p 6-6
46m Gilroy t Jackson c 6-13
66m Patchell p 9-13
74m Patchell t Patchell c 16-13
78m Summerhill t Patchell c 23-13
Cardiff Blues: 15 Dan Fish (Evans 60), 14 Blaine Scully, 13 Aled Summerhill, 12 Rey Lee-Lo, 11 Tom James, 10 Rhys Patchell, 9 Tomos Williams (Jones 66); 1 Brad Thyer , 2 Matthew Rees (Dacey 68), 3 Salesi Ma’afu (Filise 40), 4 Jarrod Hoeata (Cook 73), 5 James Down, 6 Josh Turnbull, 7 Ellis Jenkins, 8 Manoa Vosawai (Navidi 62)
Replacements: 16 Kristian Dacey, 17 Thomas Davies, 18 Taufa’ao Filise, 19 Macauley Cook, 20 Josh Navidi, 21 Lewis Jones, 22 Jarrod Evans, 23 Garyn Smith