Xavi's side struggled in the first half at Estadi Montilivi, with its frustration compounded by the loss of Ousmane Dembele to injury before the break.
The visiting side improved after half-time and sealed three points just past the hour when Pedri marked his 100th game for the club with his fifth league goal of the season.
The result moved Barca six points clear at the league summit, although Real Madrid can reduce the deficit when it hosts third-placed Real Sociedad on Monday (AEDT).
Barca suffered a blow in the 26th minute when Dembele pulled up holding his left leg, with the France international replaced by Pedri.
The 20-year-old midfielder initially did little to spark life into Xavi's spluttering side, which went in at the break having mustered just two tame efforts on target.
Pedri came to the fore after the interval, though, tapping in from close range in the 61st minute after Paulo Gazzaniga failed to deal with Jordi Alba's low cross from the left.
Girona responded well to that setback with Michel's side putting significant pressure on the Barca backline in the closing stages.
An unmarked Ivan Martin inexplicably fired wide from six yards late on, with the Blaugrana ultimately scraping maximum points as they bid to win their first title since the 2018-19 season.