Fabian Brunnstrom scored for Detroit and Jimmy Howard stopped 19 shots.
Van Riemsdyk and Jagr scored 52 seconds apart late in the first period to erase the Red Wings' 1-0 lead.
Van Riemsdyk tied it 1-all with 2:34 left in the opening period and Jagr gave the Flyers the lead for good with 1:42 remaining in the first.
Philadelphia's victory came a night after a banana was thrown from the stands as Wayne Simmonds scored for the Flyers during a shootout in a 4-3 loss. Simmonds, who is black, did not play Friday night but was seen signing autographs.