It was a cagey start to proceedings at Walter Padbury, with Uni's monopoly of possession countered by staunch defence from the home side limiting the visitors to only a couple half chances in the opening 15.
Gosnells snatched the lead against the run of play at 25 minutes, with the right-hand side left with plenty of space, which Farmer exposed and coolly curled home to make it 1-0.
UWA continued to dominate general play but still couldn't find a way to break down a resilient City defence.
Things went from bad to worse for Uni, with Gosnells player Colsani rising highest to head home from a corner with 39 minutes played.
Almost immediately from the restart, UWA responded from the penalty spot. Alex Kretowicz dribbled past the keeper and was brought down with an open goal at his mercy, but the gloveman only received a yellow card. Kretowicz dusted himself off and slotted home to make it 2-1 just before halftime.
Star striker Kretowicz was forced to make way for Patrick Morrison at half time, with a serious shoulder injury sustained when winning the penalty.
The visitors pressed for an equaliser, with Junior injected into the attack at the hour mark for Tom Moroney, but it was Gosnells who scored first in the second stanza, however, with Caleb Aquino intercepting a back pass and capitalising to make it 3-1.
UWA again responded from the spot following a wild handball from Jacob Collard after some great work from Tim Robertson. Conor Devlin stepped up and made no mistake from 12 yards to make it 3-2 with 15 to go.
Despite a late flurry of chances, including two strikes from substitute Richard Olson, it ended up a disappointing 3-2 loss.
Credit to Gosnells, who defended soundly throughout the encounter and made the most of their chances in front of goal following errors at critical times from the Uni defence.
In other results, the 18's suffered a 4-1 loss and the reserves triumphed 3-1.