Brent Seabrook and Patrick Kane scored 25 seconds apart late in the third period to tie it, but van Riemsdyk made sure the Flyers shook off the disappointment from their Winter Classic loss.
Scott Hartnell, Harry Zolnierczyk and van Riemsdyk scored goals in a span of 4:20 in the second period, and Jakub Voracek also scored for the Flyers against Ray Emery in his first game back in Philadelphia.
Ilya Bryzgalov made 30 saves to earn his first win since Dec. 13.
Claude Giroux set up van Riemsdyk's winning goal with a perfect pass to Hartnell, who slid the puck across the crease to his new linemate. Van Riemsdyk, filling in for injured Jaromir Jagr on the top line, shot it into an open net to give the Flyers a 5-4 lead.
Jimmy Hayes and Andrew Shaw also scored for Chicago. It was the Blackhawks' first game in Philadelphia since skating off the ice with the Stanley Cup after their overtime victory in Game 6 of the finals on June 9, 2010.
Coming off a 3-2 loss to the New York Rangers in the Winter Classic across the street at Citizens Bank Park, the Flyers started slow and didn't score until the final minute of the first period.
Braydon Coburn's slap shot from the point sailed wide of the net and ricocheted off the boards to Voracek, who wristed it in from the left circle.
The Blackhawks went up 1-0 when Hayes scored following a turnover by Zac Rinaldo in Philadelphia's zone. Rinaldo's clearing attempt went to Jamal Mayers, who sent a shot toward the net. Hayes redirected it past Bryzgalov.
Rinaldo made up for his gaffe right after the ensuing faceoff. The rookie enforcer took on Shaw, giving the youngster a tough introduction in his NHL debut. Rinaldo's first punch opened a huge gash above Shaw's left eye and blood squirted onto the ice.
Shaw wiped off the blood from the fight and showed off his offensive skills in the second period, giving the Blackhawks a 2-1 lead. He skated in from behind the net, made a nifty move around Kimmo Timonen and backhanded a shot past Bryzgalov.
But the Flyers answered quickly.
Hartnell's tying goal came 17 seconds later. Hartnell swatted a behind-the-net pass from Giroux past Emery for his 18th goal.
Zolnierczyk scored the go-ahead goal off a rebound of Sean Couturier's shot, and Van Riemsdyk also put in a rebound 23 seconds later for a 4-2 lead.
Van Riemsdyk moved up from the fourth line to the top line to replace Jagr, who injured his left calf against the Rangers.
Seconds after Hartnell's deflection hit the post, Seabrook got the Blackhawks within 4-3. His wrist shot fluttered above Bryzgalov's right shoulder.
A turnover by Marc-Andre Bourdon set up Kane's tying goal. Bourdon's clearing pass went to Jonathan Toews. Kane then blasted a shot from the slot just under the crossbar. An angry Bourdon smashed his stick across the net, breaking it into two pieces.
Bryzgalov, who signed a nine-year, $51 million contract in June, didn't start the last two games and wasn't disappointed about watching the Classic from the bench. He even told reporters that Sergei Bobrovsky gave the Flyers a better chance to win. They blew a 2-0 lead against the Rangers.
Bryzgalov wore new pads, a brown leather pair reminiscent of the ones former Flyers goalie Pelle Lindbergh used. Lindbergh died in a car accident in November 1985, a few months after winning the Vezina Trophy.
Emery got a second chance in the NHL two years ago with the Flyers, but his stint in Philadelphia ended prematurely. He had hip surgery and missed the Flyers' run to the Cup finals.
Notes: This was the only meeting between the teams this regular season. ... The Flyers have won nine straight regular-season games at home against the Blackhawks. Chicago's last win was Nov. 9, 2006. ... Giroux has 19 points in his last 11 games.