Preheat the oven to 425 degrees . In a large nonstick skillet, cook the ground beef over medium-high heat until no longer pink, about 5 minutes; season with salt and pepper. Using a slotted spoon, transfer to a bowl. Add the onion to the skillet and cook, stirring, until softened, about 5 minutes. Add the garlic and cook, stirring, for 1 minute more. Add the onion mixture to the beef.
Line a baking sheet with parchment paper. On the baking sheet, roll out the piecrust and trim into a 12-inch square; save the trimmings. Cut the crust into four 6-inch squares. Divide the beef mixture evenly among the squares. Fold in 2 opposite corners of each square and pinch to close. Fold in and pinch the remaining 2 corners; pinch the seams together. Patch any holes with the trimmings. Bake until the crust is golden-brown, about 20 minutes.
Meanwhile, in a bowl, combine the carrots, raisins, mayonnaise and sugar; season with salt. Serve with the knishes.