The magic of Matawalu took Glasgow Warriors to within touching distance of last night's opponents at the top of the RaboDirect Pro12 table on a night of magnificent entertainment at Scotstoun.

Niko Matawalu had won the man-of-the-match award in each of his three previous games but the Fijian surpassed those performances as he inspired an extraordinary win achieved in spite of Glasgow's failure to kick any points. He had already shown what he was capable of when setting up his team's second try while playing at scrum-half but, having been forced to switch to the wing, he was twice involved in the move that ended with him registering the four-try bonus point.

Peter Horne's fifth missed shot at goal allowed the league leaders to sneak off with an undeserved losing bonus point. However, on his first appearance at stand-off, the 23-year-old put in an otherwise accomplished night's work, including starting the move that produced that fourth try.

His failure with the boot denied his side the perfect outcome, but it was only a minor disappointment on a night when Glasgow were by far the better team. They had twice slipped behind in the first half to penalties by Ruan Pienaar, Ulster's Springbok half-back, but the pattern for the night was set as those scores sandwiched Glasgow's opening try.

It was the result of well executed, defence-stretching play as they initially went left – Horne's well-weighted miss pass finding Peter Murchie, who got to within five metres of the line. Three rapid rucks ensued, sucking in more and more defenders until the ball was fired right where, with a two-man overlap outside him, Mark Bennett committing the last man before allowing Tim Swinson to stroll in. It was the lock's fifth league try of the season and it was perhaps a measure of the confidence among the side that he had given some thought to his celebrations, performing a version of England winger Chris Ashton's swallow dive before touching down.

Not that they could afford to be over-confident against as resilient a side as Ulster, even as undermanned as they were last night, and a reminder was offered almost immediately as they got within a few metres of registering a try. The move broke down after a handling error but Ryan Wilson, the Glasgow captain, was given a severe talking to for multiple infringements by his side and Pienaar duly knocked over the penalty.

Glasgow continued to look the better side, though, and in 28 minutes they were rewarded thanks to the sharp reactions of livewire Matawalu. Robbie Diack looked to have control of the ball at the base of a secure Ulster scrummage on his own 22. His footwork momentarily betrayed him and the Fijian scrum-half was immediately onto it and away, drawing Neil Walsh to him before sending Tommy Seymour clear to the line. Despite being halfway to their third successive four-try bonus point, it was worrying for Glasgow that Horne missed for the third time in three kicks with the conversion.

Pienaar uncharacteristically missed an opportunity just before the interval, too, and Glasgow were then presented with an even bigger bonus by the other Ulster half-back within half a minute of the restart. Paddy Wallace looked to have more than enough time to retrieve and clear the ball close to his own line, but he was ponderous and allowed full-back Peter Murchie to charge down then gather the bouncing ball on the line to register his side's third try. Despite leading three tries to nil, Glasgow were still not able to move clear, though, as Horne's conversion attempt slid wide once more.

Ulster then held out during a lengthy spell of Glasgow attacking and, eight minutes after the break, it became one-score game when Pienaar knocked over a third penalty.

Before play restarted there was a stoppage as DTH van der Merwe was treated for a head injury before being stretchered off and Glasgow lost momentum. Just after the hour mark, it looked as if the pressure was about to be upped when Ulster appeared to score their first try. An attack that had started with Michael Allan on the right wing progressed when Stuart Olding danced his way in close under the posts, the ball being shifted left for Neil Walsh to send Diack over in the corner. The final pass, though, was deemed to have been forward.

However, Ulster were now in the ascendancy and that status was confirmed when sweeping attacking play – working the ball left then right – ended with Olding being sent in on the overlap. Pienaar could not find the target with conversion attempt from the touchline, though, leaving Glasgow in the tantalising position of being one point ahead and one try short of the full complement of points with 13 minutes remaining.

That set up a perfect ending for the hosts. Horne fielded the ball midway inside his own half and identified the space, jinking right before releasing Matawalu. The Fijian bolted forward before brilliantly off-loading to James Eddie, who carried the ball into Ulster territory before Sean Kennedy, another replacement, offered the link, smuggling the ball to Matawalu, who arrived at full tilt to take his pass and race to the line.