David Wright and Jeff Francoeur also homered for the Mets, riding their longest winning streak since a 10-game run in July 2008.
Coming off a 9-1 homestand that produced a surprise lead in the NL East, New York dominated its first meeting this season with the rival Phillies, winners of two consecutive pennants and three straight division titles.
With the Phillies already down big in the ninth, Brad Lidge was hit hard in his first outing of the year.
Francoeur came out in the seventh with a bruised left elbow, soon after he was hit by a pitch from Danys Baez. In the eighth, Mets rookie Jenrry Mejia plunked Chase Utley on the leg.
Niese (1-1) shut down Philadelphia's powerful lineup, allowing one run and four hits for his third major league win and first since July 25, 2009, at Houston. He matched a career high with seven strikeouts.
The left-hander yielded Carlos Ruiz's RBI single in the second, then retired 14 straight until Jayson Werth's single leading off the seventh.
Wright and Francoeur connected during a three-run second inning against Kyle Kendrick (0-1). Jason Bay doubled leading off and scored on Wright's homer to straightaway center. It was Wright's 12th homer at Citizens Bank Park, more than any other active visiting player, and 20th overall against the Phillies.
Francoeur added a solo shot two batters later. Barajas, who drove in three runs, homered leading off the fifth and continued to torment his former team. Since his one unpopular season in Philadelphia in 2007, Barajas is 12 for 21 with six homers, three doubles and 13 RBIs against the Phillies.
It was Barajas' ninth career multihomer game and second this season. He also homered twice on April 9 against Washington.
Barajas' second homer came off Lidge, who was making his 2010 debut after missing the first month of the season following operations on his right knee and right elbow. The closer gave up sharp hits to two of his three batters in the ninth, managing only one out on a liner to right.
New York scored four runs in the seventh off Baez, who walked Niese during the rally. Barajas hit an RBI double, Angel Pagan had a two-run triple and Jose Reyes singled home another run.
Pagan finished with three hits, including a double. Barajas also scored three times from the No. 8 spot in the batting order.
The Mets have won only three of their last 14 games against Philadelphia, and two of nine at Citizens Bank Park.
NOTES: It was Niese's first appearance against the Phillies. ... Francoeur remained in the game after he was hit by Baez's pitch, then was replaced in right field in the bottom of the seventh by Gary Matthews Jr. ... Mike Pelfrey, New York's scheduled starter for Saturday, leads the majors with an 0.69 ERA. His 24-inning scoreless streak is the longest in the big leagues.