One way is to be brave and see if the tag on the bag is VIE. If so, check it in and see if it comes out in VIE.
Another way is to be prepared and also see if it comes out of baggage claim at LGA. If so, then bring it to JFK. If not, you may be in luck (but also may not see the bag for 3-4 days, so pack carefully)