Gatland's glorious 12-year stint as Wales coach came to an end after the Rugby World Cup, where he led the team to their second fourth-place finish of his tenure, but the New Zealander was back in Cardiff to lead his old team's opponents.
His successor Pivac made a winning start, though, as wing Josh Adams and hooker Ken Owens crossed for two tries apiece, though a late BaaBaas fightback meant the margin of victory was only 10 points.
Gatland was afforded a rousing reception when he was shown on the big screen at the Principality Stadium while BaaBaas captain Rory Best, Ireland's most-capped forward, was given a standing ovation when he was substituted in the second half of his final appearance.
FULL-TIME in Cardiff
We go down 33-43
— Barbarian FC (@Barbarian_FC) November 30, 2019
Wales led 19-7 at the break as Adams, the World Cup's leading try-scorer, went over along with international debutant Johnny McNicholl and Owens.
Further tries from Owens and Adams after the break put Wales firmly in charge, while substitute Gareth Davies also got in on the act.
The Barbarians scored five tries in total - four of them coming after the break - as Josh Strauss, Curwin Bosch, Shaun Stevenson, Craig Millar and Peter Samu all crossed.
Photo Getty Images Caption: Wayne Pivac