Captain Philipp Lahm gave the German giants an early lead before substitute Mario Mandzukic finished the job with a late effort as they claimed the Uli Hoeness Cup.
Last season's treble winners were greeted by a full house at the Allianz Arena as they looked to keep up their recent fine form.
Spain Under-21 captain Thiago Alcantara lined-up in the Bavarian's star-studded midfield which included Holland's Arjen Robben and France winger Franck Ribery as, in typical fashion, Guardiola started without a recognised striker.
It took just 14 minutes for Bayern to open the scoring through Lahm, who continued in his new midfield role under Guardiola.
Franck Ribery's delicious inswinging cross was cushioned past the onrushing Pinto by the 5ft 6in Germany international.
Lionel Messi, who was making his first competitive start of the summer for the Spanish champions, was kept quiet for much of the half although he came close with a firm drive from the edge of the area and a 25-yard free-kick, which drifted harmlessly over the crossbar.
With Gerardo Martino set to take over at Camp Nou on Friday, it was left to Jordi Roura to pick the side and he opted to make a whole host of changes for the start of the second half.
Many of the Barcelona 'B' team were handed an opportunity to shine and the likes of Oier, Patric, Planas, Samper, Ilie, Espinosa, Nieto and Dongou all impressed.
However, Bayern finished the job with three minutes remaining as Emre Can split the Barcelona defence wide open with a slide rule pass to Diego Contento, who slid the ball across for Croatia international Mandzukic to finish off the move with a simple finish from close-range.
It was perfect preparation for the German giants who now travel to face Borussia Dortmund on Saturday in the German Super Cup in a repeat of the UEFA Champions League final, which the Bavarians won 2-1 at Wembley in May.