Combine pork and beans, onion, ketchup, mustard, brown sugar, molasses, gherkin juice, and vinegar in a 2-quart casserole. Bake, uncovered, for 1 hour.
Meanwhile, partially fry bacon to remove some of the fat. Drain bacon on paper towels; discard drippings. Top beans with strips of bacon in a crisscross pattern. Bake, uncovered, for 30 minutes. Let stand 15 minutes before serving. Makes 7 to 9 servings.