The Pirates avoided a season sweep by the Dodgers, who had beaten them nine straight times, dating to last year. The Dodgers were looking for their first four-game sweep in Pittsburgh in 63 years.
Alvarez hit his 22nd homer as part of a 3-for-4 day. Clint Barmes added three RBIs for the Pirates, who entered the day tied with St. Louis for the NL's second wild card spot.
Jordy Mercer and Andrew McCutchen were on base both times Jones homered, in the first and fifth innings. The second shot to right elicited a curtain call for Jones, who has 20 home runs this season and five career two-homer games.
Burnett (15-4) allowed six runs, seven hits, and a walk, and he hit two batsmen, but he was good enough to become the first Pirates pitcher to win 15 games since Todd Ritchie in 1999.
Burnett had seven strikeouts and bounced back from his first home loss of the season on Saturday.
Burnett, who called a players meeting before Wednesday's game, was most angry after the Dodgers took their only lead in the fourth when Ramirez hit a two-run homer.
As Ramirez rounded second base during his home-run trot, he circled his eyes with his fingers as he turned in the direction of Burnett. The gesture is a trademark of Ramirez's.
When Ramirez struck out swinging to end the sixth, Burnett screamed at him as he walked off the mound. Ramirez was reprimanded by Campos for throwing his bat, and the two had a somewhat-heated discussion.
That wasn't close to being the most contentious moment of the game.
Kemp struck out swinging to end the first, although a 1-0 pitch during the at-bat was a called strike. It wasn't until Andre Ethier led off the next inning that Kemp was ejected by Campos while in the dugout. By that point, Jones had homered to give the Pirates a 3-0 lead.
Oddly, Kemp was tossed after a pitch that was called a ball.
Kemp's ejection angered Mattingly, who sprinted out to Campos. Kemp wasn't far behind, and needed to be restrained, at different times, by Mattingly, teammate Shane Victorino, bench coach Trey Hillman and other umpires. He bumped into an umpire at least once.
After a few minutes of arguing, Mattingly was ejected by crew chief Tim Tschida. Mattingly stayed on the field for several more minutes of animated discussion before an umpire summoned Hillman to come out to retrieve Mattingly.
When play resumed, Ethier grounded out, but Loney homered two batters later. It was his first home run since May 21 and third of the season.
Blanton (8-11) fell to 0-2 since being acquired in a trade from Philadelphia. Blanton gave up eight runs, seven hits and a season-high four walks in 4 1-3 innings.
Notes: Mattingly's ejection was his sixth this season; Kemp was tossed for the first time. ... Jones' first homer marked the first time Pittsburgh had scored first in 10 games. ... Ramirez's home run was his 16th and second in 21 games with Los Angeles. ... The Pirates will play the Cardinals in six of their next 12 games, starting with a weekend series in St. Louis beginning Friday. RHP James McDonald (10-5, 3.77) starts Friday, and Pittsburgh has lost each of his past four outings. ... The Dodgers travel to Atlanta to complete their 10-game road trip with three games against the Braves. LHP Chris Capuano (11-8, 3.11) starts Friday against Atlanta RHP Tommy Hanson (12-5, 4.29).