The Pirates snapped a three-game losing streak and moved to within five victories of their first winning season in 21 years.
Pittsburgh held a 4-1 lead when Byrd hit his 22nd homer. The blast came after Josh Harrison and Jody Mercer had both reached on infield singles to open the seventh.
Andrew McCutchen's single drove in Pittsburgh's first run in the opening inning, Gaby Sanchez had an RBI base hit in the fourth and the Pirates added two in the sixth when Harrison singled in Jose Tabata and then scored on a double from Mercer.
Charlie Morton (6-3) picked up the win by giving up one unearned run in 6 2/3 innings. He held the Brewers to five hits.
Tom Gorzelanny (3-6) allowed four runs on nine hits in 5 1/3 to absorb the loss.
Benedict Cumberbatch's dramatic reading of R. Kelly lyrics is just what you need
Gal Gadot cast as Wonder Woman for 'Batman vs. Superman'